Skip to content

Instantly share code, notes, and snippets.

@prontiol
Created March 25, 2015 16:11
Show Gist options
  • Save prontiol/660680a661ea266aa14a to your computer and use it in GitHub Desktop.
Save prontiol/660680a661ea266aa14a to your computer and use it in GitHub Desktop.
Shell script for splitting pls playlist into single entry chunks
PLAYLIST=$1
echo "Using file: $PLAYLIST"
N=`grep 'NumberOfEntries' $PLAYLIST | sed 's/^.*=//g'`
echo "Total entries: $N"
for ((i=1; i<=$N; i++)) do
PLAYLIST1="playlist$i.pls"
echo '[playist]' > $PLAYLIST1
echo 'NumberOfEntries=1' >> $PLAYLIST1
echo `grep File$i= $PLAYLIST | sed 's/^.*=/File1=/g'` >> $PLAYLIST1
echo `grep Title$i= $PLAYLIST | sed 's/^.*=/Title1=/g'` >> $PLAYLIST1
echo 'Length1=-1' >> $PLAYLIST1
done
echo "Done"
@MarkVisser
Copy link

Thank You !!

@tloehr
Copy link

tloehr commented Dec 4, 2015

coolio. thanks for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment