Click here to get back home

Scan Microsoft Office files

 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
Scan Microsoft Office files Will Fawcett 09-03-2004
Get Chitika Premium
Posted by Will Fawcett on September 3, 2004, 12:41 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 wfsp on September 3, 2004, 12:22 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
Office / Adobe programming? June 18, 2006, 7:05 pm
nntp scan February 7, 2005, 4:51 pm
News::Scan question August 9, 2004, 12:10 am
Using C::Scan : How to ignore #includes ? September 23, 2004, 7:54 pm
How to scan Keyboard in Perl or else on Linux ? November 4, 2004, 6:45 pm
scan a string from right to left using PRX expression August 6, 2005, 9:50 pm
C::Scan module doesn't support old C function defintions... March 14, 2005, 12:06 am
Scan forward n lines from specified file offset November 5, 2006, 2:33 pm
DBI and Microsoft Access March 9, 2005, 2:45 pm
Microsoft Hatred FAQ October 14, 2005, 7:01 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap