Click here to get back home

similar articles algorithm based on numeric indexing of all rows via columns in a table

 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
similar articles algorithm based on numeric indexing of all rows via columns in a table julie_smith 01-18-2005
Get Chitika Premium
Posted by julie_smith on January 18, 2005, 6:42 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 Gunnar Hjalmarsson on January 18, 2005, 3:44 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

Posted by Anno Siegel on January 18, 2005, 10:41 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
removing rows based on two duplicate fileds September 12, 2007, 7:31 pm
Merge multiple rows and remove duplicates --based on the first value January 26, 2006, 5:47 pm
DBI: adding columns to table May 18, 2005, 4:43 pm
getting NewsGroup articles, June 29, 2005, 9:56 am
PLucene minimum for indexing? November 2, 2006, 11:41 am
Both Methods and Indexing for Objects? July 31, 2007, 9:18 am
Net::NNTP, retrieving articles help please December 17, 2004, 3:14 pm
Where to get all the articles in this group? (My net is 1KBps) November 10, 2005, 4:02 pm
Indexing word documents with perl? November 3, 2004, 2:02 am
full-text indexing of pdf, rtf, txt, html November 16, 2005, 5:36 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap