I have an Input.txt file which contains the absolute address:
I am running the batch file from this directory: "D:\FINAL\FINAL_3\mybatch.bat" The Input.txt is present in: "D:\FINAL\FINAL_3\Input.txt"
Input.txt:
D:\FINAL\FINAL_3\xx\yy\User\src\abc.c D:\FINAL\FINAL_3\qq\ww\src\def.c
Output_Template.txt
Line 1: BLA BLA BLA
Line 2: BLA BLA BLA
Line N: BLA BLA BLA
RelativeFile = File =
Line 1: BLA BLA BLA
Line 2: BLA BLA BLA
Line N: BLA BLA BLA
Now, I need to create a new Output.txt file using the information present in Input.txt, and Output_Template.txt:
Output.txt
Line 1: BLA BLA BLA
Line 2: BLA BLA BLA
Line N: BLA BLA BLA
RelativeFile = .\xx\yy\User\src\abc.c
File = D:\FINAL\FINAL_3\xx\yy\User\src\abc.c
RelativeFile = .\qq\ww\src\def.c
File = D:\FINAL\FINAL_3\qq\ww\src\def.c
Line 1: BLA BLA BLA
Line 2: BLA BLA BLA
Line N: BLA BLA BLA
What I'am doing is:
Reading the contents of Input.txt and writing it into Output.txt
for /f "tokens=* delims= " %%a in (%CD%\Input.txt) do (
echo FILE=%%a >> %file_name%
)
this is only printing:
File = D:\FINAL\FINAL_3\xx\yy\User\src\abc.c
File = D:\FINAL\FINAL_3\qq\ww\src\def.c