Extracting strings from text file -
i have file compile2.txt following data in it:
compile log of application: information version: 1.0    revision: 940 compile date/time: 04/02/2013 05:03:16  elapsed time: 5.53 seconds summary: total of 917 steps , 127 objects compiled.          total errors(0) , warnings(0).  --- end of compile report --- i need extract application, revision , date/time information using batch file. how can achieve this? expected output should follows:
information 940 04/02/2013 05:03:16  
@echo off  setlocal enabledelayedexpansion /f "tokens=*" %%a in (compile2.txt) (     set linec=%%a     set linetest=!linec:compile log of application=!     if not [!linec!]==[!linetest!] set app=!linec:compile log of application: =!     set linetest=!linec: revision=!     if not [!linec!]==[!linetest!] set rev=!linec:version: 1.0    revision: =!     set linetest=!linec:compile date/time: =!     if not [!linec!]==[!linetest!] set when=!linec:compile date/time: =! ) echo !app! - !rev! @ !when! endlocal pause run , see if gives want
Comments
Post a Comment