[gnuwin32 - Help] RE: gawk treats pipe FS-delimiters inconsistently
"SourceForge.net" <[email protected]> Fri, 14 May 2010 04:27:40 +0000
| Newsgroups | gmane.comp.windows.gnu.user |
|---|---|
| Message-ID | <[email protected]> |
Read and respond to this message at: https://sourceforge.net/projects/gnuwin32/forums/forum/74807/topic/3707582 By: lowella Yes, you're doing something wrong. The pipe symbol '|' is the regex alternation operator so you are telling gawk that the field separator is either 'a bunch of blanks' or 'a bunch of blanks'; so gawk does exactly what you ask it to do. Try FS=" *[|] *" and you should see a difference--[] is used to create a character list. However, based on how your data is structured and the regex FS seperator, field $1 will be null so your code won't print the column with NULLs in it. You probably want to use print $2, $3, $4, $5, $6. HTH _____________________________________________________________________________________ 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 ------------------------------------------------------------------------------