Quote:
Originally Posted by grail
@gary185 - How does your solution solve for the OP's original question?
He asked how to move a file called :- [ABC.DE] Album - 02 - This is the name.mp3
To a file called :- This is the name.mp3
|
the real question is why you are now asking on behalf of the OP about what i wrote.
He can of course run it and see what it does and decide for himself if it was usefull.
isn't life fascinating that way ?
if you asked really for an answer there was this seemingly little understood obscure line in the OP's question.
Quote:
I tried using cut and sed command but I am not sure how to handle the whitespaces while using these commands.
|
actually i thought it WAS the actual question! somehow i doubt he needed code to actually name things "this is the name".
so i thought he needed to handle whitespace.
again
Quote:
not sure how to handle the whitespaces
|
anyway what i wrote handles whitespace which can be quite proplematic in shell scripting in my opinion.
OK sure it might not do 100% what he wants. I don't even know what he wants or needs accept to figure out how to use sed to handle whitespace. I actually don't even care but that's another issue.
I gave him sed to handle whitespace.
It might be obvious to you guys but i find sed kind of confusing and figured the guy could use some help.
see he could do this tricky thing where he ran what i wrote on a dummy filename and then adjusted it.
outcome of my code
Code:
Album - 02 - This is the name.mp3
converted to
Album_02_This_is_the_name.mp3
OK so i'm an idiot and i thought it was usefull but it's not. i will make sure i don't help you with any of my useless crap in the future.
LOL my file DID actually make a file named "this is the name" WOOT WOOT !!
sort of
so it doesn't do exactly what he wants
Oh no wait a minute perhaps that's up to HIM !!