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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Split one column in several awk

Status
Not open for further replies.

Routerdark

Technical User
Aug 26, 2016
6
VE
Hi all,

I try to split one column in four columns more. But in don't find the way.

example:

I have one file with this Format:

string1
number1
number2
number3
number4
number5
string2
number1
number2
number3
number4
number5

I tried to do that the output be just like this

string1 string2
number1 number1
number2 number2
number3 number3
number4 number4
number5 number5

Thanks you for you support.






 
into my script I use this

paste BEGIN_OUT_146.txt CONT_OUT_146.txt END_OUT_146.txt ABORT_OUT_146.txt | awk '{printf "%-15s %-15s %-15s %-15s\n",$1,$2,$3,$4}'

so I get my result =)


example
BEGIN_OUT_146, CONT_OUT_146, END_OUT_146, ABORT_OUT_146
14517 1324035 23087 4333
13766 1221546 14715 4280
13049 1221041 10362 4615
12764 1147129 7586 4200
12222 1074866 6209 3863


if exist other way please leave it here.

regards!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top