Quote:
Originally Posted by
panyam
what is name1,age1,...?..
There it will throw the error.
name1, age1 ect are arrays that hold the values of the specific strings
try this
BEGIN{FS="="}
{
gsub(/"/,"")
}
$1 ~ /Name/{name = name ","$2}
$1 ~ /Age/{age = age ","$2}
$1 ~ /Study/{study=study ","$2}
$1 ~ /Code/{code = code ","$2}
END{
split(name,name1,",")
split(age,age1,",")
split(study,study1,",")
split(code,code1,",")
for (i in name1)size ++
print "Name,Age,Study,Code"
for (i=2;i<=size;i++)
printf("%s,%s,%s,%s\n",name1[i],age1[i],study1[i],code1[i])
}
cheers,
Devaraj Takhellambam