1.

Solve : Saving variables for re-use?

Answer»

Gudday all
I am WRITING a batch that that will use lines from a file, parse as appropriate and use the PARSED infromation as parameters for the copy or move command.
The input file looks like
Code: [SELECT]\TestingTiffMoves\AU\PICKLIST\0000544B.TIF
\TestingTiffMoves\AU\PICKLIST\0000544C.TIF
\TestingTiffMoves\AU\PICKLIST\0000544D.TIF
\TestingTiffMoves\AU\PICKLIST\0000544E.TIF
\TestingTiffMoves\AU\PICKLIST\index.dat
I wish to extract the file name at the end of each line and the whole line itself and save as variables called file_name and file_path. These variables become the parameters for copy/move.
My code looks like
Code: [Select]@echo off
cls

set var file_name =
set var file_path =

for /f "eol=;" %%i in (moveTIFF.dat) do (set %%i=%file_path%
echo %%i)
for /f "eol=; tokens=4 delims=\" %%j %%k in (moveTIFF.dat) do (set %file_name%=%%j
echo %%j)
copy %file_name% %file_path%
At the moment only the last file (index.dat) is ACTUALLY moved or copied. I am sure that the error(s) are PAINFUL obvious but i cannot find it (them).
Any advice?



Discussion

No Comment Found