Click here to get back home

Welcome to my webside that provides help in English Study for Chinese..

 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
Welcome to my webside that provides help in English Study for Chinese.. nonamehuang 01-14-2008
Get Chitika Premium
Posted by nonamehuang on January 14, 2008, 8:46 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 John W. Krahn on January 14, 2008, 8:59 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
Looking for Chinese->English Translation Script September 13, 2005, 8:29 pm
Create a chinese directory (folder) by Perl in Windows 2000 English OS September 21, 2004, 4:51 pm
perldoc of study November 13, 2006, 9:54 am
[perl-python] unicode study with unicodedata module March 15, 2005, 3:10 am
print chinese char September 9, 2005, 9:05 am
how to read Chinese filenames? June 5, 2006, 5:49 pm
I use TK to show some chinese web page, I get nothing,why? November 25, 2006, 9:00 pm
could XML::Simple handling chinese character? June 16, 2007, 11:55 pm
anybody have experience in url decode (included chinese gb2312 character) ? August 27, 2004, 1:39 pm
www.hetong168.com Chinese biggest contract website first A2A gateway October 17, 2005, 11:02 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap