[GnuWin32-Users] [gnuwin32 - Help] RE: gawk treats pipe FS-delimiters inconsistently
Provides native Win32 open source ports and utilities
Brought to you by:
gnuwin32
From: SourceForge.net <no...@so...> - 2010-05-14 04:27:53
|
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 |