|Hi, i'm having a log file wherein i need to pick up only few values/text from the matched string lines and put into another file. I'm 50% done with that. i used "FIND" command to find the matched string lines & also used ">" command to put into another file. |
like FIND /I "str" log.txt > newfile.txt
The output of this command is picking up the entire line of the matched string from the log file & put into another file.
My requirement is : need to copy only few text in the matched line & placed it into another file.
Let say for eg: log.txt contains
map1 records read: 100
map1 records written: 200
map1 records error: 0
map2 records read: 1234
map2 records written: 123
map2 records error: 2
From this log file, i need to go for search based on map name (map1,map2 etc..) and want pick up only the count of records read, written ,Error values into another file. ONLY the count values.
If i take up map1 as string then i need to put only 100,200, 0 into new file.
In unix, i know the solun, we can go for grep & cut command but i dont know how it can be done via windows batch process.
can anyone help me whats the command to CUT some text in a line using batch process?