tourcd
IS-IT--Management
- Dec 5, 2005
- 37
I have 1000’s of files generated every day that are in the format…
“xx_12345678901_ tbdy _garbage.txt”
(yes there are lots of spaces between tbdy and _garbage)
I’d like to end up with…
1234567890_tbdy.txt
So this means removing xx_ and also everything after the tbdy and putting back “.txt”.
The files live and have to remain in the same directory e.g. c:\logs
I’ve modified someone elses example script (from this forum) that happily moves the file from one directory to another but it’s not happy if I make the destination directory the same as the source.
Does anybody have a suggestion on how I might solve my problem above?
Thanks
“xx_12345678901_ tbdy _garbage.txt”
(yes there are lots of spaces between tbdy and _garbage)
I’d like to end up with…
1234567890_tbdy.txt
So this means removing xx_ and also everything after the tbdy and putting back “.txt”.
The files live and have to remain in the same directory e.g. c:\logs
I’ve modified someone elses example script (from this forum) that happily moves the file from one directory to another but it’s not happy if I make the destination directory the same as the source.
Does anybody have a suggestion on how I might solve my problem above?
Thanks