Given a log like this:
2022-03-30 21:05:00.266 +0200 CEST debug Mylog
is it possible to parse it (with a oneliner command) and skip, for example 3rd 4th and 5th
so that I would get this output?
2022-03-30 21:05:00.266 Mylog
>Solution :
perl -lane 'splice @F, 2, 3; print "@F"'
-lremoves newlines from input and adds them to output-nreads the input line by line, running the code for each line-asplits each line on whitespace into the @F array- splice removes three elements from @F starting with position 2 (numbering starts at 0)