ExNavy91
Joined: 12 Oct 2008 Posts: 3
|
Posted: Mon Jun 08, 2015 10:13 pm Post subject: If..Then |
|
|
I have looked through the forums, but I obviously can't phrase my search well enough to find what I'm looking for. I can't be the only person that needs to do something like this.
How can I perform an action only on certain items in a folder? For example, in a folder I have files that are titled as follows:
The Righteous Brothers - Little Latin Lupe Lu.mp3
Roy Orbison - The Crowd.mp3
The Chordettes - Lollipop.mp3
I want to change only filenames that start with 'The' so after running PFrank, the list would look as follows:
Righteous Brothers, [The] - Little Latin Lupe Lu.mp3
Roy Orbison - The Crowd.mp3
Chordettes, [The] - Lollipop.mp3
I have used this sequence of commands to change the files:
Search ^The Replace , [The] -
Search (?x)(.*?)[ ]*?[-]+(?x)(.*?)[ ]*?[-]+[ ]*?(.*)$ Replace \2 \1 -\3
Search (?x)[ ]*[-][ ]* Replace -
Which does the job nicely as long as ALL the filenames start with 'The'
So what I'm asking , I guess, is how to do something like:
:TOP
Get Filename
IF the file name begins with 'The' (^The) THEN
Replace it with ,[The] -
Execute Swap commands
END IF
IF (there are more files) THEN GOTO TOP
Thanks for your help! |
|