|
Posted by PerlFAQ Server on February 10, 2006, 6:03 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 February 10, 2006, 7:50 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 Tintin on February 11, 2006, 1:51 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 John W. Kennedy on February 11, 2006, 10:49 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 Jürgen Exner on February 11, 2006, 11:41 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 Threads | Posted | | FAQ 4.18 Does Perl have a Year 2000 problem? Is Perl Y2K compliant? | February 14, 2005, 12:03 pm |
| FAQ 4.18 Does Perl have a Year 2000 problem? Is Perl Y2K compliant? | May 16, 2005, 11:03 pm |
| FAQ 4.18 Does Perl have a Year 2000 problem? Is Perl Y2K compliant? | August 1, 2005, 10:03 am |
| FAQ 4.18 Does Perl have a Year 2000 problem? Is Perl Y2K compliant? | August 28, 2005, 4:03 am |
| FAQ 4.18 Does Perl have a Year 2000 problem? Is Perl Y2K compliant? | February 26, 2006, 12:03 am |
| FAQ 4.18 Does Perl have a Year 2000 problem? Is Perl Y2K compliant? | April 13, 2006, 3:03 am |
| FAQ 4.18 Does Perl have a Year 2000 problem? Is Perl Y2K compliant? | May 15, 2006, 3:03 am |
| FAQ 4.18 Does Perl have a Year 2000 problem? Is Perl Y2K compliant? | June 15, 2006, 3:03 pm |
| FAQ 4.18 Does Perl have a Year 2000 problem? Is Perl Y2K compliant? | August 15, 2006, 9:03 pm |
| FAQ 4.18 Does Perl have a Year 2000 problem? Is Perl Y2K compliant? | October 22, 2006, 9:03 am |
|