Click here to get back home

Building a Perl based online survey and data gathering, reporting and analysis tool

 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
Building a Perl based online survey and data gathering, reporting and analysis tool George_V 10-05-2004
Posted by George_V on October 5, 2004, 12:53 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 Abhinav on October 5, 2004, 3:06 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
Tool to create Perl based scripts February 20, 2007, 5:52 am
WIN32::OLE and Data Analysis Add-in December 16, 2006, 4:44 am
Gathering Source files April 21, 2005, 2:57 pm
Any module for gathering system statistics? January 15, 2007, 11:26 am
Pulling data based on date time returns error August 16, 2006, 1:41 pm
Vote this survey May 13, 2006, 9:26 am
Web Reporting Enhancement September 23, 2006, 8:55 am
how to break a survey into chunks August 20, 2005, 9:37 pm
Call graph analysis of perl source? November 13, 2006, 9:52 pm
Unix Scripting Education Survey November 11, 2006, 6:56 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap