@echo off
set hr=%time:~0,2%%time:~3,2%
set hr=%hr: =0%
@echo on
fart Test.txt HHmmXXXX HHmm%hr%
I want to run a batch that finds and replaces something in the Test.txt file. I dont mind if it can be done without the fart utility but I use it since i dont know if I can do it without it. I have a string within the txt file that says HHmm1234 these digits have to be replaced with the sys time. The part with sys time works but I can't get the "NUMBERS AFTER THe HHMM" or simply put I need to replace the HHMM(+Next4Characters) to HHMM(sys time) and i dont know the syntax to get the 4 characters. The utility does not offer a way so i have to use the Batch syntax same way I use it for getting the sys time..
Get next 4 chars after the substring
Moderator: DosItHelp