LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
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 12-05-2003, 08:29 PM   #1
mymojo
Member
 
Registered: Oct 2003
Distribution: Slackware 9.1
Posts: 176

Rep: Reputation: 30
mp3 files - replacing blank spaces with _ script?


could someone lead me to a script? say they're all under one directory...

to convert "Music - Cool Artist.mp3" to "Music_-_Cool_Artist.mp3"
 
Old 12-05-2003, 09:03 PM   #2
GT_Onizuka
Member
 
Registered: Aug 2003
Location: Atlanta
Distribution: Debian, OS X
Posts: 711

Rep: Reputation: 30
Although I'm not a script guru and alternate solution would be to download an ID3 tag editor called EasyTag it has a way you can change the filename to change all spaces into underscores and various things. It's cool try it out.
 
Old 12-05-2003, 09:03 PM   #3
ac1980
Member
 
Registered: Aug 2003
Location: Trento, Italy
Distribution: Debian testing
Posts: 394

Rep: Reputation: 30
a rough perl script. may have problems with filenames containing special char.
must be run from within the directory:
perl renspaces.pl *

#!/bin/perl
while ($_=$old=shift) {
s/\s/_/g;
rename("$old",$_)
}
 
Old 12-06-2003, 01:54 AM   #4
slakmagik
Senior Member
 
Registered: Feb 2003
Distribution: Slackware
Posts: 4,113

Rep: Reputation: Disabled
If you get easyTAG, be sure to get the patches - otherwise, it won't do precisely what you want - spaces to underscores. First time I downloaded it, I missed those and had to recompile. easyTAG's nice but kind of limited. No TagScanner.
 
Old 12-08-2003, 04:33 AM   #5
mymojo
Member
 
Registered: Oct 2003
Distribution: Slackware 9.1
Posts: 176

Original Poster
Rep: Reputation: 30
thanks guys
 
  


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
script to remove spaces from multiple filenames jeffreybluml Linux - Newbie 36 07-31-2013 03:10 AM
a command/script for replacing a word with another jaakkop Programming 14 12-04-2005 11:21 AM
bash script with spaces Quantum0726 Programming 2 11-14-2005 10:26 PM
replacing all spaces in filenames of a directory merlin23 Linux - Newbie 1 01-11-2005 08:52 AM
Problem with SED and blank spaces BigLarry Programming 2 06-10-2004 05:57 AM


All times are GMT -5. The time now is 09:56 AM.

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