LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] joining columns/removing commas in a CSV file?

[ILUG] joining columns/removing commas in a CSV file?

Mark McLoughlin mark at skynet.ie
Wed Nov 15 13:17:27 GMT 2000


On Wed, 15 Nov 2000 Stephen_Reilly at dell.com wrote:

> sed "s/`cut -f4,5,6,7 -d',' file`/`cut -f4,5,6,7 -d',' file | sed
> "s/,//g"`/g" file
> hmmm, or you could start messing with \1 and things like that, my head's not
> quite right this morning either !! Keep fiddling with it, there is an
> elegant solution there, but it escapes me currently.
>
> steve
>

I got another ugly way ;)

perl -F',' -nae '$,=",";splice @F,3,4,join "", at F[3..6];print @F;' file

Mark





More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


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!
RSS Version
Powered by Dell