LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 05-31-2005, 09:31 AM   #1
fishbonz
LQ Newbie
 
Registered: May 2005
Posts: 1

Rep: Reputation: 0
rename file names with " ? characters


I have started encoding my CD collection and some of the files are being named with " and ? characters in the name. This is not a problem with Linux but becomes a problem when I share the files with SAMBA and try to access them with Windows.

I can rename these by hand one at a time but there are so many of them that I need to try and find an automated way to remove the characters with a script or with some setting on Linux to prevent files from being named with these characters.

I am using Mepis which is a Debian distro. I am ripping the files with KAudioCreator which uses Lame to encode the file. KAudioCreator access freedb.org for the track names which is where the " and ? characters are coming from.

Any help with renaming these files is appreciated.
 
Old 05-31-2005, 10:09 AM   #2
Technoslave
Member
 
Registered: Dec 2003
Location: Northern VA
Posts: 493

Rep: Reputation: 30
usually in programs like that, you can - under some option, tell it to make those type of characters and _ or some such. That's the first thing I would check.

After that, the ones that you already have, you may be able to find a rename program that will do it for you, otherwise it's a roll your own solution.
 
Old 05-31-2005, 11:20 AM   #3
makuyl
Senior Member
 
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 54
A script like this should do it:
#!/bin/sh
for i in *.mp3
do
mv $i `echo $i|sed -e 's/?//g'`
done

Just change it according to needs, make it executable and run it in the directory with the files. Alternatively you can put it under /usr/local/bin/ and give it some unique name.
 
  


Reply



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
renaming file names beginning with "-" prashln Linux - General 5 05-01-2010 01:47 AM
Can i limit new file names created to 8 characters with samba ? amitsharma_26 Linux - Networking 1 12-16-2005 05:42 AM
rename file with "mv" not working for folder? Niceman2005 Linux - Newbie 2 03-13-2005 09:34 PM
"Edit and rename swaret conf" or whatever. PROBLEM! Kjetil4455 Slackware 8 04-14-2004 03:00 PM
need help, on how to access quickly to special characters like "ñ" or "á"? Motaro Linux - Newbie 1 12-31-2003 11:53 AM

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

All times are GMT -5. The time now is 04:30 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
Open Source Consulting | Domain Registration