Data retrieval using Batch script

June 7, 2012 at 10:54:09
Specs: Windows XP
I have log file that has log information, i need to pull data for specific date& time (24hours data) using Batch script.
Appreciate if anybody helps on this.
Log info. looks likes this:
Wed Jun 06 05:50:15 EDT 2012 INFO: Check Fail TS:20120607105024z uid:xatest
----
----
Thu Jun 07 05:50:15 EDT 2012 INFO: Check Fail TS:20120607105024z uid:vdtest

See More: Data retrieval using Batch script

Report •


#1
June 7, 2012 at 12:27:12
::check.bat
::references check.log, please adjust to name
::using the following formula Wed Jun 06 05:50:15 EDT 2012 INFO: Check Fail TS:20120607105024z uid:xatest
for /f "tokens=4,11" %%G in (c:\check.log) DO echo %%G %%H>>newlog.log
::and outputs date and uid to newlog.log
::not sure where you wanted to use the information, so i directed to a new log.
::feel free to give more options and parameters.

:: mike


Report •
Related Solutions


Ask Question