This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Amarok displaying _20 instead of spaces

Tags: None
(comma "," separated)
pingbat
Registered Member
Posts
2
Karma
0
I was sent a load of mp3's by a friend and they all have "_20"  where i would expect the spaces to be.

Is there a script i can use to fix this?

Can i write my own? I don't know any scripting languages, only C.

Please help!!
User avatar
Alanceil
Registered Member
Posts
160
Karma
0
OS
Code: Select all
#!/bin/bash
while [ "$1" != "" ] ; do
        INFILE="$1"
        OUTFILE="`echo $INFILE | sed 's/_20/ /'`"
        mv "$INFILE" "$OUTFILE"
        shift
done


should do the trick. Start it with <1st mp3> <2nd mp> etc.. (e.g.: ./replace20 *.mp3)
If you get an argument list too long error, use xargs: ls -1 | xargs ./replace20
pingbat
Registered Member
Posts
2
Karma
0
Ok, that's awesome, thanks.

When I say a load, I mean 60 so is there a way to get it to do the contents of a folder?

Not that I don't lore you for the script  :-)
User avatar
marcel
Registered Member
Posts
595
Karma
0
OS
pingbat wrote:When I say a load, I mean 60 so is there a way to get it to do the contents of a folder?


Alanceil's script is doing this already.
User avatar
Alanceil
Registered Member
Posts
160
Karma
0
OS
Sure. Just start it with the folder's name: ./replace20 /home/tux/mp3/convertme/*.mp3

Note: You might want to add a g to the sed command:  sed 's/_20/ /g'
This will convert any occurence of _20 to a " ". Without the g, only the first _20 will be changed.

Last edited by Alanceil on Tue Aug 07, 2007 12:45 pm, edited 1 time in total.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], kde-naveen, Sogou [Bot]