Hey,
Something like this?
awk -F, '{print $1 "," $2 "," $3 "," $4 $5 $6 $7 "," $8 "," $9}'
/path/to/cvs/file
Brian.
-----Original Message-----
From: Gary McCloskey [mailto:Gary.McCloskey at rte.ie]
Sent: 15 November 2000 11:33
To: ilug at linux.ie
Subject: [ILUG] joining columns/removing commas in a CSV file?
big CSV file, need to merge particular columns.
=> removing particular commas, e.g. to join the 4th,5th, 6th and 7th
columns, remove the 4th, 5th, 6th commas
1,2,3,4,5,6,7,8,9 => 1,2,3,4567,8,9
thought that tr, cut or paste might help : just gave me a headache
perl is obvious answer, but perl skills have left me this morning.
I've made life easier by having no quotes, and hence no commas inside
quotes.
Suggestions please, either a utility or perl snippet.
If I manage to get both brain hemispheres working and figure it out for
myself, I'll post an answer.
Gary
---
Digital TV Technologies,
RTE.
SMS messaging - http://gmccloskey.virtualave.net
--
Irish Linux Users' Group: ilug at linux.iehttp://www.linux.ie/mailman/listinfo/ilug for (un)subscription information.
List maintainer: listmaster at linux.ie
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!