bakr_2k5 0 Report post Posted December 6, 2006 (edited) Hello there,Today I've encoded lots of mp3's for my portable mp3 player (which only has 128mb ... ), Anyway I encoded them with Lame using mlame script (for those don't know it handles more files then one).Now mlame appends "-new-converted-file" to the filename. And renaming every individual file with the hand is A LOT of work . I tried to write a script to remove that "-new-converted-file" but they kinda all failed! And the "tr" command seems it can't handle sentences.Well does anyone in here have a clue or a nice script to do this? :POf course if you only give me a hint to do this. I'll write the script on my own. But if you feel like, you're free to do it (Please no reply about use "sed" or something like that without some explanation, I really don't know anything about it. And I just can't understand the whole "sed" thing . Thank you!)Bakr_2k5 Edited December 6, 2006 by bakr_2k5 (see edit history) Share this post Link to post Share on other sites
Markymark2 0 Report post Posted December 6, 2006 I can point you to the right direction I hope..I would use a lightweight PERL script to do this..its perfect for the job!Google up some cool PERL scripts and I am sure you will find one that can rename/replace etcGood Luck!Markyl) Share this post Link to post Share on other sites
bakr_2k5 0 Report post Posted December 6, 2006 (edited) I can point you to the right direction I hope..I would use a lightweight PERL script to do this..its perfect for the job!Google up some cool PERL scripts and I am sure you will find one that can rename/replace etcGood Luck!Markyl)Searched for while for PERL scripts, but the all seem web orientated or CGI stuff. So no real use.But I just discovered a standard linux program (at least I think it's standard ) called "rename".Very oblivious, well my topic lately are a bit lame guess I need more sleep... Anyway I just do this:CONSOLE rename -new-converted-file.mp3 .mp3 *.mp3And it works So problem solved, and thank you Mark420 for your reply!Think I'm going to work on a script for Nautilus (gnome's file manager) to integrate this stuff Bakr_2k5 Edited December 6, 2006 by bakr_2k5 (see edit history) Share this post Link to post Share on other sites
qwijibow 0 Report post Posted December 8, 2006 1)I would be very surprised if there wasnt a parametr you could pass to the script to cause it NOT to add that string to the file name.2)You Have the source code !!!Edit the Script.Is this not the reason we love open source ???if it doesnt do exactly what you want it to... re-program it. Share this post Link to post Share on other sites
bakr_2k5 0 Report post Posted December 8, 2006 (edited) 1) I would be very surprised if there wasnt a parametr you could pass to the script to cause it NOT to add that string to the file name.  2) You Have the source code !!! Edit the Script. Is this not the reason we love open source ??? if it doesnt do exactly what you want it to... re-program it.  Answer to 1:No there isn't some kind of parameter in mlame or lame itself! CONSOLE This script runs the LAME mp3 encoder on multiple files:  /usr/bin/mlame [options] <file 1> ... <file n>  options: -? this help text -r remove files after encoding -f force overwrite of destination if exists -l low quality settings -h high quality settings -o "<lame options>" overrides script default options  example: /usr/bin/mlame -r -f -o "-v -V 0 -b 112" a*.wav z*.aif g*.mp? And have tried all those parameters and none did the thing I wanted! Answer to 2: Yes you're completely right, but I don't consider myself a good programmer. I know some basics but none of the advanced stuff (soon it will come). Perhaps I'm a bit to faint-hearted (got that word from babelfish ), to do these things!  Bakr_2k5 Edited December 8, 2006 by bakr_2k5 (see edit history) Share this post Link to post Share on other sites
nightfox1405241487 0 Report post Posted December 9, 2006 2)You Have the source code !!!Edit the Script.Is this not the reason we love open source ???if it doesnt do exactly what you want it to... re-program it.Amen to that!! Doesn't have to be "open" source... take IPB. Not open source, but the source code is available for modifications![N]F Share this post Link to post Share on other sites
borlafu 0 Report post Posted December 10, 2006 2)You Have the source code !!!Edit the Script.Is this not the reason we love open source ???if it doesnt do exactly what you want it to... re-program it. Anyway I think he's not going to fix and recompile the program, and then reencode the songs just to change their name...Take it easy:man rn Share this post Link to post Share on other sites
vujsa 0 Report post Posted December 11, 2006 Well, I just couldn't resist getting involved. I just spent the last 2 hours writting a script to do this for you.It is PHP based and you may have to move your files to your web root to work but it will strip all of the unwanted formating from your filenames. In linux, you may also need to change the file permissions to do the rename.The script is completely insecure and needs to be placed in a secure location such as a password protected directory. Failure to secure this script will give anyone with public access to your system the ability to rename ALL of your files. This is a very dangerous script if use improperly.The script may be found here:http://forums.xisto.com/no_longer_exists/Registration is required for download, sorry. I do this to prevent excessive automated downloading by theft bots etc...I hope this helps. vujsa Share this post Link to post Share on other sites