|
That's pretty cool. thanks. It doesn't fully solve for me though.
I should have mentioned I have to add some to it, and add commas.
So I can use the tr command to go to newfile, then:
cat newfile|awk '{printf("mydata,moredata,%s,%s,%s\n",$1,$2,$3) }'
but, even that is not a full solution yet, because how will the script know how many fields are in the file, and be able to decide how many elements to put on the right side of the printf statement ?
For eg, if the file had 10 columns that the tr command turned into one line with 10 fields, how will I create a print statement that will know there were 10 fields so I can use them ?
Thanks,
floyd
|