[PLUG] Awkward Field Separators
Rich Shepard
rshepard at appl-ecosys.com
Tue May 13 15:29:52 UTC 2008
On Tue, 13 May 2008, wes wrote:
> are the commas or spaces unique to field separators? I would probably just
> fix the field separators that are wrong, and then grab the fields normally.
wes,
Here's what I've tried, but it does not work as desired:
BEGIN {FS = " "}
{print $1, $2, $3}
{FS = ","}
{print $4, "," $3, "," $2, "," $1}
If I add the 4th field to the first print statement, nothing's changed.
The output of this version is totally messed up.
Any thoughts on the path to the proper approach?
Thanks,
Rich
--
Richard B. Shepard, Ph.D. | Integrity Credibility
Applied Ecosystem Services, Inc. | Innovation
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
More information about the PLUG
mailing list