I have 12 columns separated by a tab. How can I join them side-by-side?
[Added] You can also tell me other methods as AWK: the faster the better.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Since you asked specifically about awk (there are tools better suited to the job), the following is a first-cut solution:
A more complicated and configurable solution, where you could change the number of columns used for output, would be:
Other possibilities, if you’re not restricted to awk, are:
Based on your edit and comments, I suggest cut is the best tool for the job. Use ‘
man cut‘, ‘info cut‘ or ‘cut --help‘ for more details (this depends on your platform).