-1

I have log file where each line is showing warning

17>C:\Work\gital\DK\GK\astl/algorithm.h(1186): warning C4389: '==' : signed/unsigned mismatch (C:\Ga\gate\source\src\MainSc.cpp)

17>C:\Work\gital\DK\GK\dgfgtl/string.h(1084): warning C4127: conditional expression is constant (C:\Ga\gate\source\src\FreeSc.cpp)

From each line, I want to get the part of string

algorithm.h(1186): warning C4389: '==' : signed/unsigned mismatch MainSc.cpp

string.h(1084): warning C4127: conditional expression is constant FreeSc.cpp

If I could get these extracts it would be great. Basically I have log file with warnings data and I want to extract sub-part from the same.

1 Answers1

0

For the given 2 lines cut is the easiest answer. Depending on the other lines, you way want something else:

cut -d/ -f2 logfile
grep -Eo "/.*" logfile
sed 's/.*astl.//' logfile
Walter A
  • 19,067
  • 2
  • 23
  • 43