Click here to get back home

printLDIF wraps long lines of 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
printLDIF wraps long lines of text Mike 10-22-2004
Posted by Mike on October 22, 2004, 3:07 pm
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
long lines October 28, 2004, 12:25 pm
--chop-long-lines April 2, 2007, 10:04 am
split long string over two lines June 15, 2005, 10:22 pm
m// on very long lines leaks memory March 13, 2008, 5:26 pm
Pulling out lines of text from a text file March 9, 2006, 3:54 am
HTTP::Request::Common and long Text via POST March 13, 2006, 9:55 am
turn text lines into a list June 27, 2005, 4:33 am
Stick Lines and Dividers Between Text February 2, 2007, 2:43 am
Grep Text File for Lines Containing 1 or 2 Words January 25, 2005, 5:50 pm
Remove blank lines from text file September 10, 2005, 11:23 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap