android
Prev Previous Post   Next Post Next
  #2  
Old 05-19-2008, 11:10 PM
cptdodno cptdodno is offline
Junior Member
 
Join Date: May 2008
Posts: 18
Default

OK, xmms sort of does what I need, with the following changes:

edit the m3u file xmms creates to

1. remove everything up to and including /../.../MUSIC
2. change the slashes '/' to backslashes '\'
3. change the unix <cr> to the dos <cr><lf>

and bingo, you have a working .m3u file....

Fortunately all that nonsense can be easily scripted with sed + tr

Here's a script that should convert an xmms .m3u to a sansa m3u. You must run it from within the Sansa tree. It will scan the entire MUSIC tree looking for unprocessed .m3u files and change them.

#!/bin/bash
#1. remove everything up to and including /../.../MUSIC/
#2. change the slashes '/' to backslashes '\'
#3. change the unix <cr> to the dos <cr><lf>
CR=$(printf '\r')
for m in `find $PWD -name '*.m3u'` ; do
[[ `grep MUSIC $m` ]] || continue
echo found $m
nm=`basename $m`
dm=`dirname $m`/
mv $m /tmp/$nm
cat /tmp/$nm | sed "s+^$dm++" | tr '/' '\\' | sed "s/\$/$CR/" > $m
rm /tmp/$nm
done

Last edited by cptdodno; 05-20-2008 at 03:25 PM.
Reply With Quote

 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 11:33 AM.