how to match some words and add Timestamp after them

August 31, 2014 at 05:40:44
Specs: Windows server 2008
I have some files in C:\A\B\C\ and with this echo %DATALIST% I can get one of the names of the files in C:\A\B\C. suppose the output of echo %DATALIST% is “file-test” so we have C:\A\B\C\file-test.

I want a batch script which

goes to C:\A\B\C\ directory and
opens the file which matches the %DATALIST% output and
again in that file it looks and insert “timestamp” for whatever comes after "AAA" or "BBB" and before "{".

Example:

AAA mmmmmmmmmm {

After running the script: AAA mmmmmmmmmm_timestamp {

My small script:

@echo off

echo %DATALIST%

for %%DATALIST in C:\A\B\C\

????

any suggestion?


See More: how to match some words and add Timestamp after them

Report •

#1
August 31, 2014 at 23:03:21
You need to clarify a bit.

Do the lines of interest always START with AAA [ or BBB ] followed by a space?

=====================
M2 Golden-Triangle


Report •
Related Solutions


Ask Question