Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Rearranging dataset 1

Status
Not open for further replies.

hill007

Technical User
Mar 9, 2004
60
US
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.
 
something like this:

NF == 1 { print $0;next }
{printf("%s ", $0) }


vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
For uniform spacing:
Code:
1==NF { print; next}
{$1=$1; printf "%s ", $0 }
 
good point, futurelet!

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top