BEGIN { while(getline x < F) { if(x ~ /@attribute/) { split(x,attribute," "); if(attribute[2] ~ /^'/) { attribute[2]=substr(attribute[2],2,length(attribute[2])-2); } if(attribute[3] ~ /^'/) { split(attribute[3],poss,","); count=0; for(p in poss) { count++; } for(i=1;i<=count;i++) { if(i==1) { poss[i]="{"substr(poss[i],3,length(poss[i])-3); sub(" ","",poss[i]); out=poss[i] } else if(i==count) { poss[i]=substr(poss[i],2,length(poss[i])-3)"}"; sub(" ","",poss[i]); out=out","poss[i] } else { poss[i]=substr(poss[i],2,length(poss[i])-2); sub(" ","",poss[i]); out=out","poss[i] } } print attribute[1]" "attribute[2]" "out } else print x } else if((x !~ /^[ \t]*$/)&&(x !~ /@attribute/)&&(x !~ /@data/)&&(x!="")&&(x !~ /@relation/)&&(x !~ /^%/)) { split(x,line,","); count=0; for(c in line) { count++; } for(j=0;j<=count;j++) { if(line[j] ~ /^'/) { line[j]=substr(line[j],2,length(line[j])-2); sub(" ","",line[j]); } if(j==1) out=line[j] else out=out","line[j] } print out } else print x } close(F); }