LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 07-27-2004, 10:14 AM   #1
xxfunkxx
LQ Newbie
 
Registered: Jul 2004
Location: Vienna
Distribution: Debian Sid
Posts: 26

Rep: Reputation: 15
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
 
Old 07-27-2004, 10:29 AM   #2
tuxrules
Senior Member
 
Registered: Jun 2004
Location: Chicago
Distribution: Slackware64 14.1
Posts: 1,138

Rep: Reputation: 55
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.)
 
Old 07-27-2004, 11:09 AM   #3
Corona4456
Member
 
Registered: Jul 2004
Distribution: SuSE 9.1
Posts: 66

Rep: Reputation: 15
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
 
Old 07-27-2004, 02:14 PM   #4
xxfunkxx
LQ Newbie
 
Registered: Jul 2004
Location: Vienna
Distribution: Debian Sid
Posts: 26

Original Poster
Rep: Reputation: 15
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
 
Old 07-27-2004, 02:37 PM   #5
Corona4456
Member
 
Registered: Jul 2004
Distribution: SuSE 9.1
Posts: 66

Rep: Reputation: 15
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.
 
Old 07-28-2004, 02:31 AM   #6
xxfunkxx
LQ Newbie
 
Registered: Jul 2004
Location: Vienna
Distribution: Debian Sid
Posts: 26

Original Poster
Rep: Reputation: 15
OK. I will try to learn some perl.
 
  


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
Distro Information from Bash shifty_eyes Linux - Newbie 7 10-13-2005 08:18 PM
Bash information os2 Programming 2 03-21-2005 12:38 AM
how do I modify .mp3 information (artist/title)? servnov Linux - General 5 11-12-2004 03:21 AM
change console title in bash script? TLV Linux - Software 18 10-08-2004 11:25 AM
Extract information from mail boxes pcwulf Linux - Software 0 06-20-2004 08:04 PM


All times are GMT -5. The time now is 06:24 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration