INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Split one column in several awk

Split one column in several awk

(OP)
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.






RE: Split one column in several awk

(OP)
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!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close