|
Posted by J. Fowler on August 14, 2006, 2:26 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 axel on August 14, 2006, 3:28 pm
Please log in for more thread options
> dennishancy@eaton.com wrote:
>> Ok, well I am getting closer.
>> I have the value "c:\someDirName\scriptName.pl" stored in a variable.
>> Now the rest should be easy (if I only knew my regular expression
>> syntax).
> getcwd => perldoc Cwd
getcwd deals with the current working directory, not with the location
of a particular script.
Axel
|
|
Posted by Jürgen Exner on August 14, 2006, 8:27 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 dennishancy@eaton.com on August 15, 2006, 10:26 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 Dr.Ruud on August 15, 2006, 10:40 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 | | Perl and current directory | December 9, 2006, 4:41 am |
| Apache vs IIS current directory fro Perl script | May 8, 2008, 3:09 am |
| how to use Perl to rename the filenames and directory names under current and subdirectories recursively? | September 1, 2004, 2:37 pm |
| current directory, practical problem | June 17, 2008, 9:42 am |
| Platypus - Current Working Directory - write files | November 5, 2007, 7:06 pm |
| Re: Platypus - Current Working Directory - write files | November 6, 2007, 7:25 am |
| Platypus - Current Working Directory - write file | November 6, 2007, 1:19 pm |
| Re: Platypus - Current Working Directory - write file | November 6, 2007, 1:29 pm |
| Re: Platypus - Current Working Directory - write file | November 6, 2007, 2:04 pm |
| Re: Platypus - Current Working Directory - write file | November 6, 2007, 2:30 pm |
|