|
Posted by Amontec, Larry on August 23, 2005, 8: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 Jim Gibson on August 23, 2005, 12:37 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 John Bokma on August 23, 2005, 7:58 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 Thomas Kratz on August 24, 2005, 1:13 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 Daniel Zinn on August 24, 2005, 4:52 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 Threads | Posted | | Perl interaction with Expect | February 14, 2007, 3:54 pm |
| JavaScript for User interaction. | April 28, 2006, 7:45 am |
| Google calendar interaction | October 8, 2006, 12:49 am |
| sleep/fork/shell/SIGCHLD interaction problem | November 11, 2007, 10:41 am |
| Language Perl | June 19, 2007, 3:53 am |
| FAQ 7.1: Can I get a BNF/yacc/RE for the Perl language? | November 19, 2004, 12:03 am |
| FAQ 7.1: Can I get a BNF/yacc/RE for the Perl language? | December 28, 2004, 6:03 am |
| FAQ 7.1 Can I get a BNF/yacc/RE for the Perl language? | February 10, 2005, 12:03 pm |
| FAQ 7.1 Can I get a BNF/yacc/RE for the Perl language? | May 17, 2005, 11:03 pm |
| FAQ 7.1 Can I get a BNF/yacc/RE for the Perl language? | August 2, 2005, 4:03 am |
|