LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-14-2012, 07:15 AM   #1
punkska1977
LQ Newbie
 
Registered: Nov 2005
Posts: 4

Rep: Reputation: 0
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
 
Old 02-14-2012, 07:21 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975
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

Last edited by acid_kewpie; 02-14-2012 at 07:22 AM.
 
Old 02-14-2012, 07:39 AM   #3
punkska1977
LQ Newbie
 
Registered: Nov 2005
Posts: 4

Original Poster
Rep: Reputation: 0
Hey Chris !

it's working even with ska

thx a lot that was fast !

Jo
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
bash shell script read file line by line. Darren[UoW] Programming 57 04-17-2016 06:07 PM
[SOLVED] Bash script to read line by line and execute commands Striketh Programming 4 11-06-2011 11:38 AM
VLC loading default playlist or any other playlist from command line r00tb33r Linux - Software 0 12-29-2008 10:24 PM
How to add a new line in bash divya_linux Programming 4 10-17-2007 09:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration