How to strip everthing other than a word in line?


#1

i.e "Movie Name : Chameli (2004) Singer : Sunidhi Chauhan Music Director : Sandesh Shandilya"

Is it possible to extract "Sunidhi Chauhan" out of this Line and put it in the "Artist" tag with the parser of mp3tag?

I cannot use FindInLine command as Singer is not always returned by the server. So FindInLine Command error outs. So all i can do is strip out the unwanted data whenever Singer info is returned.

I am trying this command regexpreplace "^[^S]+" "" which removes everthing before "Singer" if the movie name does not start with "S"

How do I modify this regex to strip everything before only if the word is Singer?

What about striping everything on and after "Music Director"?

Please help as I am very close to making the first script that will help anybody looking to tag Indian Music.

any help is much appreciated.


#2

As a starting point:

$regexp(Movie Name : Chameli (2004) Singer : Sunidhi Chauhan Music Director : Sandesh Shandilya,Movie Name : (.+?) Singer : (.+?) Music Director : (.+),$2)

gives 'Sunidhi Chauhan'.

DD.20080626.1210.CEST


#3

Thx a lot. Got it working. Basically this is what I did if anyone else is interested.

#Artist(S)
MoveLine -1
MoveLine +1
killtag "*"
regexpreplace "^(\s)" ""
regexpreplace " (.+?)   " ""
regexpreplace "Singer(.+)" "Singer"
regexpreplace "(.+?)Singer" "Singer"
outputto "Artist"
if "Singer"
        MoveLine -1
        MoveLine +1
        killtag "*"
        if " Singer"
            regexpreplace "Singer : " ""
        else
            regexpreplace "(.+?) Singer : " ""
        endif
        regexpreplace "   (.+)" ""
        if "  ,"
            MoveChar 4
        endif
        sayrest
        Say "|"
else
        Say "|"
endif

This will output anything in between Singer : and Music Director : if Singer exists.