[102372] in RedHat Linux List
Re: parsing text files
daemon@ATHENA.MIT.EDU (Vidiot)
Wed Dec 2 16:51:25 1998
From: Vidiot <brown@ftms.COM>
To: redhat-list@redhat.com
Date: Wed, 2 Dec 1998 15:50:25 -0600 (CST)
In-Reply-To: <NCBBKAHLNJCALPEJDMAEKEADCEAA.elazor@hcs.state.or.us> from "Ed Lazor" at Dec 2, 98 01:32:01 pm
Resent-From: redhat-list@redhat.com
Reply-To: redhat-list@redhat.com
>Just thought you guys might like to know the solution I came
>up with. I just piped the output to
>
> nawk '{print $1}'
>
>and that command filtered out the 1st column. Replace $1 with $2 to get
>the 2nd column and so on.
>-Ed
Won't work. Each and every space acts as a column separator, which means
that the first "human" column, which contains the person's name, can have more
than one name there. So that means that $2 could be the person's first or
last name (depending if the file is first last or last, first). If there is
a third part of the person's name, the address column may not start until $4,
instead of $3.
MB
--
System Administrator - Finnigan FT/MS - Madison WI. URL:http://www.ftms.com/
e-mail: brown@ftms.com phone: (608) 273-8262 ext: 612 fax: (608) 273-8719
[Where do you think Microsoft would be today if they waited]
[until their software worked? (Hyperion Bay - 10/12/98)]
Visit - URL:http://www.vidiot.com/ (Your link to Star Trek and UPN)
--
PLEASE read the Red Hat FAQ, Tips, Errata and the MAILING LIST ARCHIVES!
http://www.redhat.com http://archive.redhat.com
To unsubscribe: mail redhat-list-request@redhat.com with
"unsubscribe" as the Subject.