|
comp.lang.perl.misc - PERL programming language
|
|
|
|
|
Posted by Smarta55 Chris on June 26, 2005, 10:49 pm
Please log in for more thread options
show/hide quoted text
>> [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,
show/hide quoted text
> There
> is a rogue carriage return (0xd) in the string
show/hide quoted text
> 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 A. Sinan Unur on June 27, 2005, 3:38 am
Please log in for more thread options
show/hide quoted text
>> [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,
show/hide quoted text
> There
> is a rogue carriage return (0xd) in the string
show/hide quoted text
> 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 Smarta55 Chris on June 26, 2005, 11:57 pm
Please log in for more thread options show/hide quoted text
>> [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,
show/hide quoted text
> There
> is a rogue carriage return (0xd) in the string
show/hide quoted text
> 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 A. Sinan Unur on June 27, 2005, 4:06 am
Please log in for more thread options show/hide quoted text
>> [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,
show/hide quoted text
> There
> is a rogue carriage return (0xd) in the string
show/hide quoted text
> 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 Smarta55 Chris on June 27, 2005, 12:19 am
Please log in for more thread options show/hide quoted text
>> [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,
show/hide quoted text
> There
> is a rogue carriage return (0xd) in the string
show/hide quoted text
> 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 | | Multi-Match (to Array) Regex with a precodition match? | August 5, 2007, 2:43 pm |
| regex to match any url | February 14, 2006, 4:02 pm |
| regex - match anything until | September 10, 2009, 12:30 pm |
| regex match on nothing | March 4, 2010, 5:22 am |
| Printing regex match | September 25, 2004, 1:27 pm |
| regex: match at least one of two expression | October 12, 2004, 10:07 am |
| match regex split | January 5, 2005, 9:09 pm |
| RegEx How to not match a string | October 3, 2005, 3:54 pm |
| "Close match" regex | December 18, 2005, 1:55 pm |
| Regex - Unexpected match for /\r/ | February 6, 2007, 8:28 pm |
|
|
>> > 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,