Click here to get back home

convert mail to mozilla format

 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
convert mail to mozilla format Alythh 07-27-2004
Posted by Alythh on July 27, 2004, 6:33 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

Posted by chris-usenet on July 27, 2004, 4:28 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
How to convert datetime format? January 26, 2006, 11:40 am
Convert windows path with space to 8.3 format ? April 4, 2006, 1:49 pm
A Script To Convert iTunes XML To Tab Delimited Format May 26, 2006, 9:16 pm
How do I convert TIME into Cookie and last-modified-time format? October 1, 2004, 3:05 pm
How to use Mozilla within Perl (to replace IE) July 29, 2004, 7:44 pm
POST data with XMLHttpRequest to CGI (Mozilla) April 30, 2005, 1:55 pm
start firefox or mozilla with username and password September 26, 2005, 9:26 pm
windows mozilla perl helper app scripts June 16, 2006, 10:00 pm
Using Mail::IMAPClient and Mail::Folder together June 2, 2005, 9:57 pm
Sending mail through Mail::Outlook May 25, 2006, 12:22 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap