On Fri, Jan 26, 2007 at 11:33:33AM +1100, Luke Yelavich wrote:
> On Fri, Jan 26, 2007 at 09:50:11AM EST, Luke Yelavich wrote:
> > Hi all
> > I have been given a spreadsheet, which I have exported to a csv file, 
> > for use with a community website I am working on.
> > 
> > I have a nasty problem, where a lot of the sells have massive amounts of 
> > whitespace. I am wondering whether there is a quick way to remove the 
> > whitespace, either in the spreadsheet, or in the csv file? I am guessing 
> > a regular expression could do it, but I am no regular expression expert.
> 
> I should clarrify my needs a bit. There are text strings in this file 
> that have spaces between words. The whitespace is only at the end of 
> fields, and all text strings have quotes around them. I also think this 
> whitespace is between the last character, and the quote in the text 
> string.

sed -e 's/ +"/"/' oldfile > newfile 

> -- 
> Luke Yelavich
> GPG key: 0xD06320CE 
>        (http://www.themuso.com/themuso-gpg-key.txt)
> Email & MSN: [EMAIL PROTECTED]
> Jabber: [EMAIL PROTECTED]



> -- 
> SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
> Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Attachment: signature.asc
Description: Digital signature

-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to