Read and respond to this message at: https://sourceforge.net/projects/gnuwin32/forums/forum/74807/topic/3707582 By: tridsisme
Hi there I'm using gawk 3.1.6 to parse some output from [b]isql [/b](Sybase) that looks like the following: [code] |data_type|type_name |precision |length |scale | |---------|----------------|-----------|-----------|------| | 4|int | 10| 4| 0| | 1|char | 7| 7| NULL| | 12|varchar | 50| 50| NULL| | 12|varchar | 35| 35| NULL| | 12|varchar | 35| 35| NULL| | 12|varchar | 35| 35| NULL| | 12|varchar | 35| 35| NULL| | 12|varchar | 15| 15| NULL| | 12|varchar | 25| 25| NULL| | 1|char | 2| 2| NULL| | 12|varchar | 30| 30| NULL| | 1|char | 1| 1| NULL| [/code] To do so, I am using a regexp FS as follows: [code] BEGIN { FS=" *| *"; OFS = "\t" } { print $1, $2, $3, $4, $5 }[/code] The result is that the fields are indeed split on the pipes, but field values all INCLUDE the pipes as well! Whereas if the pipes are say colons, and i use FS=" *: *", then i get expected results .. viz: the colons are NOT included with the field values. I have tried escaping the pipe (\|) .. but gawk reports that it is not necessary to do so: [quote]awk: awk\readpipes.awk:7: warning: escape sequence `\|' treated as plain `|'[/quote] Am i doing something wrong, or is this a bug/problem that i need to find a workaround for? TIA _____________________________________________________________________________________ You are receiving this email because you elected to monitor this topic or entire forum. To stop monitoring this topic visit: https://sourceforge.net/projects/gnuwin32/forums/forum/74807/topic/3707582/unmonitor To stop monitoring this forum visit: https://sourceforge.net/projects/gnuwin32/forums/forum/74807/unmonitor ------------------------------------------------------------------------------ _______________________________________________ GnuWin32-Users mailing list GnuWin32-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gnuwin32-users