Click here to get back home

Transpose data into a 2 dimensional array.

 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
Transpose data into a 2 dimensional array. deepak p 08-02-2004
Get Chitika Premium
Posted by deepak p on August 2, 2004, 4:00 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 Jim Gibson on August 2, 2004, 7:07 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
perl - data structure build to transpose data August 28, 2004, 9:34 pm
How to use string as two dimensional array November 2, 2005, 11:01 am
extract a column from 2 dimensional array September 13, 2004, 7:31 am
How to access a multi-dimensional array? September 19, 2005, 5:20 pm
Create two-dimensional Array from string April 2, 2008, 1:21 pm
need help with list of lists ( multi dimensional array) August 25, 2005, 7:29 am
Count values in multi dimensional array July 26, 2006, 9:41 am
Read File into multi-dimensional array ignore whitespace June 27, 2007, 2:26 pm
How do I get the data out of this array? June 4, 2007, 11:11 pm
Help with 4 dimensional implementation September 1, 2006, 7:49 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap