Answer the question
In order to leave comments, you need to log in
How to parse a file?
Good day!
There is a text file with the bind log, you need to clean it from garbage
Looks like this: 16-
May
-2019 12:24:46.733 192.168.60.223#49429
top-fwz1.mail.ru
12:24 192.168.60.223 top-fwz1.mail.ru
Help me write a regular expression...
Answer the question
In order to leave comments, you need to log in
perl -ne '/([^ ]+) (\d+:\d+)[^ ]+ (\d+\.\d+\.\d+\.\d+)[^ ]+ (.+)/; print "$1 $2 $3 $4\n"' test.txt
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question