Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
660 views
in Technique[技术] by (71.8m points)

awk - Bash Split Output Groups to Columns

I have similar output like below goes so long. I want to create columns with this output but with like groups/blocks. And process output after a pipe.

id: c2b751c227111edfgdghfhfg19079a466e1916f6df4
blob_size: 1965
weight: 1965
fee: 0.000015690000
fee/byte: 0.000000007984
receive_time: 1613453355 (3 minutes ago)
relayed: 16134535355 (3 minutes ago)
do_not_relay: F
kept_by_block: F
double_spend_seen: F
max_used_block_height: 2279513
max_used_block_id: 44fbf6656dff890aedc29ashfhdfh2f3f848dd94c2dcb79562f5b
last_failed_height: 0
last_failed_id: 0000000000000000000000000000000000000000000000000000000000000000

id: be7e8ec30c8fff9deb33702fd392a566e4a44192138086aaff2d0c9fa82cdbfe
blob_size: 1968
weight: 1968
fee: 0.000015710000
fee/byte: 0.000000007982
receive_time: 13452 (36 seconds ago)
relayed: 16113434534512 (36 seconds ago)
do_not_relay: F
kept_by_block: F
double_spend_seen: F
max_used_block_height: 2234534515
max_used_block_id: 16433ec85ab8a9e81ac714c2cc3171149dfgdfgf34eec4d42e81
last_failed_height: 0
last_failed_id: 0000000000000000000000000000000000000000000000000000000000000000

Something like;

id: 234234                id: 234234234
blob_size: 234234         blob_size: 2342342
.                         .
.                         .
.                         .
[empty line]              [empty line]
id :234234234             id: fwfsdfsdfsdf
blob_size: 24234234       blob_size: 234234
.                         .
.                         .
.                         .

I hope someone can help.

Cheers

question from:https://stackoverflow.com/questions/65832744/bash-split-output-groups-to-columns

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...