I had submitted this same question previously, but the code did not work as I intended. What it did, put all the datasets in one line.
I want to place every first three rows in one line, please see the output file.
Both vgersh99 and futurelet's code puts everything in one row. Which is not intended.
Thanks.
I have a input file as:
A B C
D E F
G
1 2 3
4 5 6
7
My output should look like this:
A B C D E F G
1 2 3 4 5 6 7
How do I do this?
Thanks a lot.
vgersh99 (Programmer) Mar 10, 2004
something like this:
NF == 1 { print $0;next }
{printf("%s ", $0) }
vlad
futurelet (Programmer) Mar 10, 2004
For uniform spacing:
CODE
1==NF { print; next}
{$1=$1; printf "%s ", $0 }
I want to place every first three rows in one line, please see the output file.
Both vgersh99 and futurelet's code puts everything in one row. Which is not intended.
Thanks.
I have a input file as:
A B C
D E F
G
1 2 3
4 5 6
7
My output should look like this:
A B C D E F G
1 2 3 4 5 6 7
How do I do this?
Thanks a lot.
vgersh99 (Programmer) Mar 10, 2004
something like this:
NF == 1 { print $0;next }
{printf("%s ", $0) }
vlad
futurelet (Programmer) Mar 10, 2004
For uniform spacing:
CODE
1==NF { print; next}
{$1=$1; printf "%s ", $0 }