Salta la navigazione

This script:

  1. specifies the delimiter as a regex
  2. filters input line based on a regex ( regex right after the first single quote)
  3. cycles through fields
  4. tests a field against a regex (if block in the loop)

gawk -F"[=\x01]" '/35=AE.*150=F/ { for (i=1; i<=NF; i=i+2) { if ($i ~/^(52|55|32|31|1117|1121|782|785)$/) { printf "%s,",$(i+1)} } printf "\n" }' file_to_parse.log

Lascia un Commento

Fill in your details below or click an icon to log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Log Out / Modifica )

Foto Twitter

You are commenting using your Twitter account. Log Out / Modifica )

Foto di Facebook

You are commenting using your Facebook account. Log Out / Modifica )

Connecting to %s

Follow

Get every new post delivered to your Inbox.