I need to modify line 5 and line 15 in a .txt file by means of a .bat modifying the date of the day.
The data to be modified would be the following:
HostFile=BIBLIOTECA/ARCHIVOddmmaa
PCFile=\servidor\carpeta\subcarpeta\ARCHIVOddmmaa
In which you automatically add today's date to the file name, for example:
HostFile=BIBLIOTECA/ARCHIVO220817
PCFile=\servidor\carpeta\subcarpeta\ARCHIVO220817
This would be the structure of the file to be modified:
[DataTransferFromAS400]
Version=2.0
[HostInfo]
Database=*SYSBAS
HostFile=BIBLIOTECA/ARCHIVOddmmaa
HostName=
[ClientInfo]
ASCIITruncation=1
ConvType=0
CrtOpt=1
FDFFile=
FDFFormat=1
FileOps=503209343
OutputDevice=2
PCFile=\servidor\carpeta\subcarpeta\ARCHIVOddmmaa
PCFileType=1
SaveFDF=0
The code to set the date in a variable I already have it:
set aa=%date:~8,4%
set mm=%date:~3,2%
set dd=%date:~0,2%
I would be missing how to edit lines 5 and 15 in the .txt file; What would it be like?