log_parser.awk 207 B

123456789
  1. $3=="P" {
  2. for(i=4; i<=NF; i++) line = sprintf("%s%s%s", line, $(i), OFS);
  3. }
  4. $3=="F" {
  5. printf("%s%s%s%s%s", $1, OFS, $2, OFS, line)
  6. for(i=4; i<=NF; i++) printf("%s%s", $(i), i<NF ? OFS : "\n");
  7. line=""
  8. }