shell-script-pt
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Transformar linhas em coluna


From: itamarnet
Subject: Re: Transformar linhas em coluna
Date: 17 Feb 2016 06:20:40 -0800

Outra sugestão para formatar melhor seria:

awk '
  BEGIN {FS=": "; print "Computer Name\tProduct Name\tProduct Key\tProduct ID"}
  /Product Name/ {split("",linhas);linha[2]=$2}
  /Product ID/ {linha[4]=$2}
  /Product Key/ {linha[3]=$2}
  /Computer Name/ {linha[1]=$2}
  /Time/ {print linha[1] "\t" linha[2] "\t" linha[3] "\t" linha[4]}
' | expand -t 15,39,70

[]'s
Itamar


reply via email to

[Prev in Thread] Current Thread [Next in Thread]