Answer the question
In order to leave comments, you need to log in
How to output strings without brackets?
There is a log file containing lines like this:
February 4 17:00:00 Motor depot [Platform, Chassis]
February 5 18:00:00 Motor depot [Platform, Chassis] February
4 19:00:00 Motor depot Direction: Workshop
How output only the first and second lines without the third in the form:
February 4 Chassis, Platform ?
Answer the question
In order to leave comments, you need to log in
grep '[\|]' logfile | awk '{print $1, $2, какие там ещё вам нужны колонки}' | sed s/меняем_скобки/на_пустоту/g
Well, if the key factor is the presence or absence of square brackets, then grep is enough .grep -E '([|])' file.log
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question