Click here to get back home

Clean out accents in French names

 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
Clean out accents in French names Patrick L. Nolan 05-17-2005
Get Chitika Premium
Posted by thundergnat on May 18, 2005, 9:45 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 Arndt Jonasson on May 18, 2005, 4:05 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
French Accents appear incorrectly... January 29, 2007, 12:36 pm
rename not working on files with accents in names April 24, 2005, 12:04 am
Learn French in the Alps. October 4, 2004, 1:27 am
Spell check French in perl September 19, 2004, 2:39 pm
detecting french character into a file? August 17, 2005, 5:38 pm
Matching a french accent character May 23, 2007, 7:36 am
Different behaviour of a german script on a french server. January 25, 2006, 10:04 am
Clean string August 14, 2006, 3:14 am
Clean Quarantine Script August 19, 2004, 12:15 pm
regex to clean path October 18, 2004, 1:34 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap