I have a file with fields as follows which has last field in multiple lines. I would like to combine a line which has three fields with single field line for as shown in expected output. Please help.
INPUT
hname01 windows appnamec1eda_p1, appnamec2eda_p2,
Vappnamec3eda_p2,
halkat-A rhel VPC1E3DEP0, VP27C1E4DEP1
vimame-B vmw PX0427E3DBF1,
VPC1E4DAEP1
poxdem-A windows VP27C1DE0,
VP27C1DE0,
VP27C1DE0,
Expected OUTPUT
hname01 windows appnamec1eda_p1,appnamec2eda_p2,Vappnamec3eda_p2,
halkat-A rhel VPC1E3DEP0,VP27C1E4DEP1
vimame-B vmw PX0427E3DBF1,VPC1E4DAEP1
poxdem-A windows VP27C1DE0,VP27C1DE0,VP27C1DE0,
Your expected output is inconsistent as to whether there should be a trailing comma at the of your output lines. Do you want all of the commas in the input to be copied to the output, or do you want to remove the trailing comma?