Click here to get back home

Perl ODBC complex query example needed

 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
Perl ODBC complex query example needed samregen 03-21-2005
Get Chitika Premium
Posted by samregen on March 21, 2005, 4:01 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 Bob Walton on March 22, 2005, 3:12 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
Perl CGI script using Win::ODBC module - failed login on December 27, 2004, 3:28 pm
getting DBI and ODBC to work with PERL and MYSQL data source March 22, 2007, 12:07 am
CGI - How to use upload_hook and query the query string ? February 7, 2006, 1:00 pm
Complex problem I need to solve with perl February 22, 2006, 2:57 pm
Perl XML::Simple Accessing complex XML June 18, 2008, 8:05 am
Perl Complex Data Structure Parsing December 3, 2006, 1:56 pm
Perl bot needed September 18, 2007, 4:22 pm
Help needed for perl rookie December 27, 2004, 10:44 pm
Perl programmer needed May 18, 2005, 4:34 pm
perl programmer needed June 22, 2006, 2:12 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap