Click here to get back home

perl script to copy mp3 files to your portable mp3 device - inetquestion

 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
perl script to copy mp3 files to your portable mp3 device - inetquestion Inetquestion 09-14-2004
Posted by Inetquestion on September 14, 2004, 1:51 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 September 14, 2004, 10: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

Similar ThreadsPosted
Write files to a USB device August 31, 2004, 9:48 pm
Using perl how do you write a script to copy a remote file into your own site December 29, 2004, 6:10 am
copy all files August 6, 2007, 4:31 am
copy directory structure without files February 8, 2005, 6:58 am
Copy multiples files to a single file in seperate pages.. March 27, 2008, 3:30 pm
Perl device IO on Win February 3, 2006, 9:21 pm
how to get perl catching a device (mic) ? January 2, 2005, 3:54 am
Perl on embedded device June 10, 2008, 5:45 pm
Can device drivers be written in Perl? December 9, 2005, 9:55 pm
backup via ftp, depth copy, script already out there? October 27, 2006, 9:09 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap