win NT batch file renamer
Discussion
Hi, following on from my search and replace query which is now working thanks.
I now have a problem in renameing the files...
the files are jobvr04-123456^0797723412
if i pass that through the batch files the ^ is replaced with a null character so my programs dont work.
to get around that i get the output program to name them jobvr04-123456£0797723412
instead..
but once modified i then need to turn the filename back to jobvr04-123456^0797723412
the overall lenght of the file may vary as the last part is a telephone number but the ^ will always be a fixed position from the left..
Any ideas, anyone fancy knocking up a few lines of code for me
cheers
graham
I now have a problem in renameing the files...
the files are jobvr04-123456^0797723412
if i pass that through the batch files the ^ is replaced with a null character so my programs dont work.
to get around that i get the output program to name them jobvr04-123456£0797723412
instead..
but once modified i then need to turn the filename back to jobvr04-123456^0797723412
the overall lenght of the file may vary as the last part is a telephone number but the ^ will always be a fixed position from the left..
Any ideas, anyone fancy knocking up a few lines of code for me
cheers
graham
rename 's/£/^/;' job*
(There should be a backslash in front of the up-arrow in this command line, but PH is removing it.)
(The "rename" program is available from CPAN or http://stason.org/works/scripts/rename.pl)
(Perl for Windows is available (for free) from Active State; www.activestate.com/)
>> Edited by zumbruk on Tuesday 31st January 15:43
(There should be a backslash in front of the up-arrow in this command line, but PH is removing it.)
(The "rename" program is available from CPAN or http://stason.org/works/scripts/rename.pl)
(Perl for Windows is available (for free) from Active State; www.activestate.com/)
>> Edited by zumbruk on Tuesday 31st January 15:43
TA using perl was an option, but now i've managed to convice the software supplier that using ^ is a bad idea if you need to do any manipulation... nt uses as a marker in regular expressions and it invalid as a filename char in unix so at some point they were alwasys going to get an problem !!!
cheers
G
cheers
G
Gassing Station | Computers, Gadgets & Stuff | Top of Page | What's New | My Stuff


