[ic] Removing carriage returns from description

Stefan Hornburg racke at linuxia.de
Sat Dec 6 17:48:48 EST 2003

On Sat, 06 Dec 2003 17:14:33 -0500
DB <DB at m-and-d.com> wrote:

> I'm sure this has come up before.. I think I even figured it out once.
> A supplier provided me with a product database in csv format. I can 
> import it into Excel or Access and it is formatted ok. But the 
> description fields contain carriage returns (I think that's what they 
> are) which show up as squares. These are causing problems when I try to 
> export to a text file. How can I remove these pesky critters? I've tried 
> many things such as fromdos in linux but can't quite get what I want. 
> Any hints? magic perl snippets?

Backup FILE first, and then run:

perl -i -pe 's/\r//g' FILE

This will remove all carriage returns from the file.


LinuXia Systems => http://www.linuxia.de/
Expert Interchange Consulting and System Administration
ICDEVGROUP => http://www.icdevgroup.org/
Interchange Development Team

More information about the interchange-users mailing list