LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to add new line to mp3 playlist bash script (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-add-new-line-to-mp3-playlist-bash-script-929276/)

punkska1977 02-14-2012 07:15 AM

how to add new line to mp3 playlist bash script
 
Hi,

i'm looking for a solution to add a newline to a mp3 playlist. I would like to add a full path to a mp3 file at each 25th line.

I already have a web radio setup but would like to add a jingle sort of "you're listening to ..."

i'm very novice in scripting but i'm welcome to your ideas

thx

Jo

acid_kewpie 02-14-2012 07:21 AM

Code:

# seq 1 100 | awk '{ if (NR % 5 == 1) {print "mynewfile.mp3"}; print}'
mynewfile.mp3
1
2
3
4
5
mynewfile.mp3
6
7
8
9
10
mynewfile.mp3
11
12
13
14
15
mynewfile.mp3
16
17

Just something like that? Change the 5 to 25 in your case, and feed it the playlist instead of a seq.

NB. This will not work with Ska though and Ska is F$%^ing awful. :P

punkska1977 02-14-2012 07:39 AM

Hey Chris !

it's working even with ska ;)

thx a lot that was fast !

Jo


All times are GMT -5. The time now is 08:39 AM.