P
Parvinder
All,
I have a file which contains complete path of the files on a seperate
line. What I want to do is execute a command for each of those files
with the path seperator as front slash ("/") instead of backslash
("\"")
Example
inputfile.txt
------------------------
c:\temp\t1\foo.txt
c:\temp\dir1\bar.txt
Following code is my code in the batch file
-----------------------------------------------------------------------
for /F "delims=:" %%X in (%~f1) do echo "CommandFile/%%~pX/%%~nxX" >>
c:\elog.txt
and this is the output
CommandFile/temp\t1\foo.txt
CommandFile/temp\dir1\foo.txt
whereas what i want is
CommandFile/temp/t1/foo.txt
CommandFile/temp/dir1/foo.txt
i.e. change the path seperator from back slash to front slash
Even if i change the input file from backslash to front slash. The
substitution modifiers (~p and ~nx) change it to a back slash
Is there any other substitution modifiers which will the complete path
with a front slash? Can i write my own substitution modifiers?
Thanks for your help
~Parvinder
I have a file which contains complete path of the files on a seperate
line. What I want to do is execute a command for each of those files
with the path seperator as front slash ("/") instead of backslash
("\"")
Example
inputfile.txt
------------------------
c:\temp\t1\foo.txt
c:\temp\dir1\bar.txt
Following code is my code in the batch file
-----------------------------------------------------------------------
for /F "delims=:" %%X in (%~f1) do echo "CommandFile/%%~pX/%%~nxX" >>
c:\elog.txt
and this is the output
CommandFile/temp\t1\foo.txt
CommandFile/temp\dir1\foo.txt
whereas what i want is
CommandFile/temp/t1/foo.txt
CommandFile/temp/dir1/foo.txt
i.e. change the path seperator from back slash to front slash
Even if i change the input file from backslash to front slash. The
substitution modifiers (~p and ~nx) change it to a back slash
Is there any other substitution modifiers which will the complete path
with a front slash? Can i write my own substitution modifiers?
Thanks for your help
~Parvinder