mercredi 25 février 2015

Remove characters before and after text string in files that don't have identical number of characters

I have a folder with PDF's I'm trying to rename. The naming structure is "XXX - XXX - YYY - XXX - XXX". I want to keep the YYY portion, however my problem is the YYY string can vary in length and the XXX strings before and after can vary in length, so I can't tell the script delete x# of characters...


The only thing constant is the number of spaces before the YYY string. There are 5 spaces, my idea is to count to 5 spaces, save the next set of continuous characters (YYY) before the next space as my string to rename the file.


I'm vaguely aware of how to setup and run batch files, enough to know this should be possible, but very unqualified to figure it out. Any help would be great appreciated!


Thanks!


Aucun commentaire:

Enregistrer un commentaire