I'm writing a processing script and need help.
I want the script to go through a directory populated with files that are similar in format to this: AA-BBB-20060505555-xxxxxxxxxxxxx.txt
and I want to pull off the first 7 characters, keep the next 6, blow away the rest and stick an extension on it.
So the end result for the example file would be 200605.txt
The part that is giving me the most trouble is the grabbing and renaming of files. I can't figure out how to 1) grab each file in the directory and 2)parse out what I want from it's name. I think I have a good handle on how to add extensions and the rest of what I need to do.
Fyi, the files in the folders are not static, they will always start with AA and end with .txt, but that's where the similarites stop.