Created
March 16, 2020 01:43
-
-
Save jmacego/51af7c731210ccb0fc32e89674559e34 to your computer and use it in GitHub Desktop.
rom folder to playlist - RetroPie PSX
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Take a folder with a structure like: | |
# File (Disc 1).bin | |
# File (Disc 1).cue | |
# File (Disc 2).bin | |
# File (Disc 2).cue | |
# ... | |
# and rename the .cue files to .CD# and then create a .m3u | |
# suitable to RetroPie | |
for i in *.cue; do | |
newfile=$(echo $i | sed -e 's/\(.\)..cue/\1\).CD\1/'); | |
echo "$newfile"; mv "$i" "$newfile"; | |
playlist=$(echo $i | sed -e 's/\s*[(]Disc.*/.m3u/'); | |
echo $playlist; echo "$newfile" >> "$playlist"; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment