-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.

0

1 Answer 1

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
Sign up to request clarification or add additional context in comments.

1 Comment

my bad, we may not be having "astl" string always it could be anything

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.