Click here to get back home

Printing Data usinf Perl to an HTML does not work with large amount of data

 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
Printing Data usinf Perl to an HTML does not work with large amount of data islamabadi 12-06-2004
Posted by islamabadi on December 6, 2004, 11:36 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 Jürgen Exner on December 7, 2004, 2:47 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
Opening large data file with Perl April 15, 2006, 1:14 am
getting DBI and ODBC to work with PERL and MYSQL data source March 22, 2007, 12:07 am
Large Data files and sizes - what are you doing about them? March 9, 2006, 1:43 pm
comparing large number of data January 6, 2007, 10:52 pm
lightweight access to large data structures? June 18, 2007, 5:20 pm
Serving Large Data From Files or From Blobs February 15, 2008, 12:44 pm
Printing and Formatting data from hash (or array) October 30, 2006, 11:31 am
perl - data structure build to transpose data August 28, 2004, 9:34 pm
send data to html form August 4, 2005, 7:06 am
posting image data (not url) from HTML to Perlscript June 6, 2006, 12:33 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap