file manipulation (easy question I think - REWORDED)
Joe P. DeCello
jpd at tardis.cl.msu.edu
Tue Jun 18 11:45:39 AEST 1991
To rephrase my previous question:
Suppose I have a file containing several lines of text.
Each line is an entry for a database (or whatever) and
let's say each line contains 8 fields. The fields are
separated by colons. I would like to be able to output
the first field of each line into a new file. I would
like these fields to be on one line in the new file and
separated by commas. The best response to my previous
posting was this:
awk '{printf "%s ", $1' < infile > outfile
I changed this to :
awk '{printf "%s, ", $1' < infile > outfile
to get separation by commas, but now I need to break off
the first field of each line from the infile at the colon.
Thanks for those who have replied to the original question
and to those who reply to this one.
--
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Joseph P. DeCello III e-mail: jpd at cad.msu.edu
Michigan State University phone: (517) 353-3027
Specialized Computing Support Services
More information about the Comp.unix.questions
mailing list