Click here to get back home

searching a "text" in word document using perl

 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
searching a "text" in word document using perl Chakravarthy Bollapalli \(IFIN 01-28-2005
Posted by Chakravarthy Bollapalli \(IFIN on January 28, 2005, 3:38 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
Help: String search in Windows 2000 doesn't find text in WindowsXP: MS Word document November 27, 2005, 9:13 am
Trying to extract Headings from a Word 2003 document using Perl January 12, 2007, 9:53 am
Trying to extract Headings from a Word 2003 document using Perl January 12, 2007, 10:20 am
xml-to-word document January 19, 2008, 4:16 pm
Win32::OLE - help request - update MS Word document March 2, 2006, 8:41 pm
How to extract part of the text (htm) file after start word until end word? May 12, 2006, 5:32 am
perl DB (pgsql)I: problems searching text strings with ' symbol (es d'ambrose) April 7, 2007, 7:30 pm
How to give (put to browser) someone PDF document, with hidden path to document. December 20, 2005, 12:22 pm
problem searching and replacing text file data April 23, 2006, 10:05 pm
count the number of occurences of each different word of a text December 26, 2007, 9:29 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap