On Wed, May 28, 2008 at 7:31 PM, Randall R Schulz <rschulz@sonic.net> wrote:
On Wednesday 28 May 2008 16:15, Greg Freemyer wrote:
On Wed, May 28, 2008 at 6:54 PM, Greg Freemyer <greg.freemyer@gmail.com> wrote:
All,
...
export FS='\024' awk '{print $1,$2,$3}' my_file > my_output
It seems to still be useing a space (' ') as the field separator. Any idea what I'm doing wrong?
...
Never mind.
I thought FS was supposed to be set at the shell level.
It had to be set inside the awk script.
Not necessarily. There's a command-line option to control the field separator:
-F fs --field-separator fs Use fs for the input field separator (the value of the FS predefined variable).
That was actually the first thing I tried. Could not get it to work. Then I read online somewhere that it was only a supported arg for legacy reasons and that the preferred usage was the FS variable. I have it working now, and with gsub(/\376/,"\"") I should have those strange quotes gone as well. (I've got the disk back connected to a windows box, so I can't test that right now. Greg -- Greg Freemyer Litigation Triage Solutions Specialist http://www.linkedin.com/in/gregfreemyer First 99 Days Litigation White Paper - http://www.norcrossgroup.com/forms/whitepapers/99%20Days%20whitepaper.pdf The Norcross Group The Intersection of Evidence & Technology http://www.norcrossgroup.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org