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

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

Re: [shell-script] Transformar linhas em coluna


From: Sidney Souza
Subject: Re: [shell-script] Transformar linhas em coluna
Date: Wed, 17 Feb 2016 11:08:00 -0200

Mais algumas formas de fazer

# echo "Product Name : Internet Explorer
Product ID : 00333-OEM-9999999-11111
Product Key : XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
Computer Name : LAB-WKS
Product Name : Windows 8.1 Pro
Product ID : 00333-OEM-9999999-00000
Product Key : XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
Computer Name : LAB-WKS" | sed ':a;N;s/\n/ /g;ta;'
Product Name : Internet Explorer Product ID : 00333-OEM-9999999-11111 Product Key : XXXXX-XXXXX-XXXXX-XXXXX-XXXXX Computer Name : LAB-WKS Product Name : Windows 8.1 Pro Product ID : 00333-OEM-9999999-00000 Product Key : XXXXX-XXXXX-XXXXX-XXXXX-XXXXX Computer Name : LAB-WKS


# echo "Product Name : Internet Explorer
Product ID : 00333-OEM-9999999-11111
Product Key : XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
Computer Name : LAB-WKS
Product Name : Windows 8.1 Pro
Product ID : 00333-OEM-9999999-00000
Product Key : XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
Computer Name : LAB-WKS" | xargs
Product Name : Internet Explorer Product ID : 00333-OEM-9999999-11111 Product Key : XXXXX-XXXXX-XXXXX-XXXXX-XXXXX Computer Name : LAB-WKS Product Name : Windows 8.1 Pro Product ID : 00333-OEM-9999999-00000 Product Key : XXXXX-XXXXX-XXXXX-XXXXX-XXXXX Computer Name : LAB-WKS

------------------------------------------------------
http://www.politicos.org.br

2016-02-17 9:45 GMT-02:00 MrBiTs address@hidden [shell-script] <address@hidden>:
 

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 17-02-2016 09:12, Verilton Lopes address@hidden [shell-script] wrote:
>
>
> Caros, bom dia.
>
> Preciso da ajuda de vocês.
>
> Contudo, não consigo colocar estes dados em linha. Ex.: <Computer Name> <Product Name> <Product Key> <Product Name> <Product
> Key> <Product ID>
>
> LAB-WKS Internet Explorer XXXXX-XXXXX-XXXXX-XXXXX-XXXXX Windows 7 Professional XXXXX-XXXXX-XXXXX-XXXXX-XXXXX
> 00333-OEM-9999999-00000
>
>

Acho que um bom ponto de partida é este:

awk '/===/ {if (NR!=1)print "";next} {printf "%s ",$0} END {print "";}' arquivo

- --
echo \
92068024550315826382182475332597232583172815031242834207741253772942036490931873625388097114598312827695369663195686275740885871064\
49559092082392224085340303317471722482382935095394721645717388708188629714392464979911474364314309646036004586317583543814023523682\
20521740203494788796697543569807851284795072334480481413675418412856581412376640379241258356436205061541557366641602992820546646995\
466P \
| dc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQEcBAEBCAAGBQJWxF1CAAoJEG7IGPwrPKWrCW0H+wcZGfb6zU4/dBH6LDVe4i7K
6WrjtUgq9srjH5E6G10qz/BmVda/uR9m2mEkEzcyKYKnyb7aqYCx2S9nPbpN3V3j
uSxL9dAXy03BzXpHK+tVfk3boN945A39JGPz07r0Z5lEFl5o+FejAkWG5UrCxaHV
US+cwrMHR2u2hRGTjKNGfYLDDLYbBOA2WtZN2rrLSsI/ReGe6Q47hW2Ch6Nwe7NB
wK8mDSIm7W0453tMKn6aujpy0N8w8YHzHQh/nZElGlAexp6EBCv8/KAyqYcEmP8N
q3s36V9c7/JG0zorRRk0bmPSHgm+k68JU6Ez/m1xDbfmsLNbB3LRiw6zU7vMQZ8=
=B3R2
-----END PGP SIGNATURE-----



reply via email to

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