|
|
|
|
Finding lines with either of two stringsIn the following example, egrep is looking for one of two different strings. If it finds one of them then it outputs the line that has that string. It is inputting text data from a log file that was produced by MsDev 6 that had been started with the undocumented /y3 switch. This switch causes MsDev to output the amount of time spent building a module. Depending upon the module type and the sort of operation being executed, the time output can be either "Spawn Time 0:00:00" or "Build Time 0:00:00". I wanted to extract those strings and output to another file.
egrep -e "Spawn Time" -e "Build Time" error.log >
d:\BuildTime.txt
The "-e" told egrep that a search expression was following. Since the -e was specified twice, two separate search expressions were entered. error.log is the file to be read. > d:\BuildTime.txt is the file that will receive egrep's output.
|
|
|