Click here to get back home

Text display like 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
Text display like table ngoc 08-23-2005
Posted by ngoc on August 23, 2005, 10:25 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 Anno Siegel on August 23, 2005, 10:14 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
Formatting a single line without effecting the entire table with the Text::Table module March 10, 2005, 11:18 am
How to display image from RAM with some text around April 28, 2006, 9:29 am
HTML table position text injector? March 17, 2005, 8:02 am
How to parse text file into hash table April 24, 2007, 1:30 pm
I need to display pdf. August 8, 2007, 1:03 pm
How to display a pdf file using CGI April 14, 2006, 6:00 pm
64 Bit integer display March 20, 2008, 4:04 pm
How to display 1.234.567.890,00 from 1234567890 ? May 5, 2008, 2:33 am
IE Doesn't Display Romanian Page! February 23, 2005, 11:30 pm
SYstem wait display March 28, 2005, 10:51 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap