Can anyone help me with this? I have an input file similar to this:
uid=ADMIN
first_name=Admin
last_name=test user
uid=Administrator
first_name=Administrator
last_name=Administrator
uid=Guest
last_name=Guest
uid=anonymous
uid=config_fwk_service
uid=pcd_service
uid=ume_service
uid=11687
first_name=Patti
last_name=Smith
uid=11693
first_name=Joe
last_name=Strummer
uid=11719
first_name=Mick
last_name=Jagger
uid=11728
last_name=Lennon
uid=11729
first_name=Eric
last_name=Clapton
And I want it to be transformed to this:
ADMIN Admin test user
Administrator Administrator Administrator
Guest Guest
anonymous
config_fwk_service
pcd_service
ume_service
11687 Patti Smith
11693 Joe Strummer
11719 Mick Jagger
11728 Lennon
11729 Eric Clapton
So some records have missing fields (like Lennon's first name) & some fields have spaces (like "test user"). The field separators are tabs.
I'm assuming awk is the best tool to use here but don't know where to start.
Thanks, Chris
uid=ADMIN
first_name=Admin
last_name=test user
uid=Administrator
first_name=Administrator
last_name=Administrator
uid=Guest
last_name=Guest
uid=anonymous
uid=config_fwk_service
uid=pcd_service
uid=ume_service
uid=11687
first_name=Patti
last_name=Smith
uid=11693
first_name=Joe
last_name=Strummer
uid=11719
first_name=Mick
last_name=Jagger
uid=11728
last_name=Lennon
uid=11729
first_name=Eric
last_name=Clapton
And I want it to be transformed to this:
ADMIN Admin test user
Administrator Administrator Administrator
Guest Guest
anonymous
config_fwk_service
pcd_service
ume_service
11687 Patti Smith
11693 Joe Strummer
11719 Mick Jagger
11728 Lennon
11729 Eric Clapton
So some records have missing fields (like Lennon's first name) & some fields have spaces (like "test user"). The field separators are tabs.
I'm assuming awk is the best tool to use here but don't know where to start.
Thanks, Chris