How can I get awk input from a file and add my own text to the data?

Posted by xs2dhillon on Stack Overflow See other posts from Stack Overflow or by xs2dhillon
Published on 2012-04-07T05:22:36Z Indexed on 2012/04/07 5:30 UTC
Read the original article Hit count: 151

Filed under:
|
|

Assume that I have a text file separated by colons. I understand how to display the entire text file or any specific column using awk. However, what I want to do is to get the awk output and then display it by adding my own text using a shell script? For example, assume that my text file is:

England:London:GMT
USA:Washington:EST
France:Paris:GMT

What I want to do is to display this input into the below format:

COUNTRY: England
CAPITOL: London
TIMEZONE: GMT

COUNTRY: USA
CAPITOL: Washington
TIMEZONE: EST

COUNTRY: France
CAPITOL: Paris
TIMEZONE: GMT

© Stack Overflow or respective owner

Related posts about shell

Related posts about scripting