|
awk routine help
Hi,
I use awk but not as a programming language. Just generally in piplelines to split things out by fields.
I am trying to accomplish this one thing that I think a short awk routine would do great for, but can't figure it out.
Lets say I have a file that contains database columns. The file looks like this:
col1
col2
col3
..
I want awk to go through that file and turn each line into an array element so that I can do a printf statement that would contain all the lines in the file in one statement. The statement would look something like this:
printf("%s,%s,%s\n", array[0],array[1],array[2])
Actually, I guess the array elements would be variablized also.
Is this a simple thing i can get some help with ?
Thanks,
Floyd
|