Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
You may need to explain a little further as it does not appear clear what you require (at least to me).
If you have 2 rows by 2 columns, what do the '...' represent?
If you are using a single field as the reference, you then say you want to sort each column based on this. If there is
only one reference point, won't all the columns end up in the same position after sorting?
Sorry for the confusion. "..." means just that I have more of those fields and rows, please ignore those. My file has 41 fields and 60 rows. I have only inputed two rows and two columns in my last post. I don't want to sort based on a particular field but I'd like to sort each column by itself based on the number after third vertical bar on that column. I just wanted 41 sorted columns in my output. Hope this helped
Based on post #3, I would use your favourite tool (awk, perl, ruby, ...) and create 41 arrays / hashes with 60 elements using the third pipe separated number as the index.
Then either sort or regurgitate the numbers in the order required.
This would require that none of the pipe separated third fields are repeated ... can you guarantee this?
If you cannot, how is the sort supposed to know where to look after this field?
Thanks schneidz for the solution but can I do this in a single command line? How can I "cut" all the columns into the individual fields?
You can POST WHAT YOU HAVE DONE AND TRIED SO FAR, as you were asked to. So far, you've posted a question, but have shown no effort of your own..not even reading the man pages on the commands you were given, which would TELL YOU how to do this.