-1

I am trying to insert string in front of each value separated by comma using . for Example input as :

abc,xyz,12345,NY,USA

expected output :

name=abc,id=xyz123,zip=12345,city=NY,country=USA
Antonio Petricca
  • 8,891
  • 5
  • 36
  • 74
SuS
  • 61
  • 1
  • 10

1 Answers1

0

I found the answer , thank you for checking

awk -F',' '{print "name=",$1,",""id=",$2,",""zip=",$3,",""city=",$4,",""country=",$5}'

This adds extra space, which I cleared using sed .

SuS
  • 61
  • 1
  • 10