Reputation: 51
I have data in this order :
Person:Joe
Age:24
City:PH
---
Person:Joe
Age:22
City:NY
And i want to achieve data in this format
John|24|PH
Joe|22|NY
I tried with custom RS and OFS but i can't do this property.
Upvotes: 0
Views: 53
Reputation: 203493
$ awk -v RS= -F'[:[:space:]]+' -v OFS='|' '{print $2, $4, $6}' file
Joe|24|PH
Joe|22|NY
Upvotes: 2