Tuesday, April 23, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 868  / 1 Year ago, wed, december 21, 2022, 9:19:23

I have a bunch of mp3s I've organised into a playlist for a party. What I'd like to be able to do is easily rename these files so that they start with the position in the playlist:



001.Track.mp3
002.Track.mp3
.
.
.


Then they can simply be played in alphabetical order. Is this possible without just doing it manually?


More From » bash

 Answers
1

You could try something like this:
I'm not sure if it needs something more but this should work.



    cat playlist.m3u | I=1 while read file; do
mv $file $I.$file.mp3;
I=$I + 1;
done;


Edit: You could need I=`expr $I + 1'; instead of I=$I + 1;


[#30541] Thursday, December 22, 2022, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
splenueak

Total Points: 448
Total Questions: 118
Total Answers: 110

Location: Vanuatu
Member since Mon, Oct 3, 2022
2 Years ago
;