HI

I don't think it like the space before  |

Should be FS="|";

Best

Marvin

On Thu, May 24, 2012 at 11:04 AM, Rich Shepard <[email protected]> wrote:
>   I'm re-reading the ORA 'sed & awk' 2nd edition because I need to modify
> data files (>130K lines in one and >45K lines in another). Should be a
> simple script but I'm getting a syntax error trying to define the OFS.
>
>   Here's a line of the data file:
> 'D-1'|'2007-12-12'|'Ag'|0.000|
>
>   Since fields in the data file are delineated with '|'. I define FS = '|'
> in the BEGIN section, but awk doesn't like me to also define OFS there:
>
> awk: ./add-non-detect.awk:7: BEGIN { FS = "|" OFS = "|" }
> awk: ./add-non-detect.awk:7:                      ^ syntax error
>
>   There's no explicit example in the book, only statements that the default
> output field separator is a space, and that's applied by putting a comma
> after the field variable. What have I missed?
>
> Rich
>
>
>
>
> _______________________________________________
> PLUG mailing list
> [email protected]
> http://lists.pdxlinux.org/mailman/listinfo/plug
_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to