LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Bash: Extract Title Information From Playlist (https://www.linuxquestions.org/questions/linux-newbie-8/bash-extract-title-information-from-playlist-210231/)

xxfunkxx 07-27-2004 10:14 AM

Bash: Extract Title Information From Playlist
 
Hi!

I need some help with a bash script!

I have created a playlist with iTunes and I want to create a new one in linux.
The playlist from ITunes look kind of the following


Code:

Artist Composer Location
xxxx xxxxx xxxxx
Fila Brazillia Power Clown \\Yoshimi\Eigene Musik\fila brazillia\06_President Chimp Toe.mp3
Fila Brazillia Power Clown \\Yoshimi\Eigene Musik\fila brazillia\08_It Loved to Happen.mp3
Fila Brazillia Power Clown \\Yoshimi\Eigene Musik\fila brazillia\10_Tunstall.mp3


All I want is to extract only the name of the file 06_President Chimp Toe.mp3
and create a new playlist that lools like this:
/mnt/hda2/music/06_President Chimp Toe.mp3
/mnt/hda2/music/08_It Loved to Happen.mp3
/mnt/hda2/music/\10_Tunstall.mp3



Can someone help me out with a little script because my scripting knowlegde is just about to begin!
Thanks in advance
xxfunkxx

tuxrules 07-27-2004 10:29 AM

Havent laid my hands on scripts yet...but you can create a playlist file using a find command.
Code:

find /path/to/your/directory -type f -name "*.mp3" > playlist.lst
it generates a file in your current directory with all the mp3 listed in a text file. I work with .lst (used for shoutcast). You can try other file type (m3u,pls etc.)

Corona4456 07-27-2004 11:09 AM

A good way to do this is to use PERL. There are a lot of resources online as to how to program in PERL. It's an excellent scripting language. http://www.activeperl.com

xxfunkxx 07-27-2004 02:14 PM

Someone else creates the playlist in a particular order.with iTunes.
I am going to build a mp3 player based on linux so I need to get this order which means I have to read the information from the playlist.

Your suggestion is good if I donīt need the order.

xxfunkxx

Corona4456 07-27-2004 02:37 PM

Quote:

Originally posted by xxfunkxx
Someone else creates the playlist in a particular order.with iTunes.
I am going to build a mp3 player based on linux so I need to get this order which means I have to read the information from the playlist.

Your suggestion is good if I donīt need the order.

xxfunkxx

Well then if order is important then I would definitely suggest PERL. It is specifically made to handle files and edit them. :)

xxfunkxx 07-28-2004 02:31 AM

OK. I will try to learn some perl.


All times are GMT -5. The time now is 01:11 AM.