Click here to get back home

Re: Splitting comma delimited text

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Re: Splitting comma delimited text DJ Stunks 05-15-2006
Get Chitika Premium
Posted by DJ Stunks on May 15, 2006, 3:13 am
Please log in for more thread options
>>
>> [snip]
>>
>> > if I print "$1\n",
>> > the file prints just fine. But, if I do something like print "$1 after
>> > \n", the whole output is messed up. If I print "before $1\n", nothing
>> > prints at all. If I print "before $1 after\n", only after prints.
>>
>> not really sure, but could be a rogue "\r" in $1,


> There
> is a rogue carriage return (0xd) in the string

> Is there something I can do to deal with this
> situation?


Repair the corrupted file:

perl -p -i -e 'tr/\r//d' bad_file


--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas

Similar ThreadsPosted
Re: trouble parsing "kind of" comma-delimited text October 3, 2008, 2:01 pm
Re: trouble parsing "kind of" comma-delimited text October 6, 2008, 7:52 am
?Merging files based on first two comma delimited fields? September 16, 2005, 11:41 am
Moving from delimited to XML June 9, 2008, 7:53 pm
parsing a tab delimited or CSV, but keep the delimiter March 22, 2007, 4:04 pm
handle tab-delimited file March 14, 2008, 8:57 pm
splitting data? November 16, 2004, 1:00 am
Splitting and keeping key/value September 26, 2006, 6:29 am
Splitting a filename March 7, 2007, 1:10 pm
splitting a line October 21, 2007, 1:50 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap