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!
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
What is the purpose of this script? Homework? How many lines it contains? If it is a very large file (I mean yours posted above is just an example) I'd start by splitting the file using split, so that it is far more easy to manage couples of values.
I guess I knew that.......not being an "Awker", I just guessed that it might not be the #1 choice here-----unless of course the instructor specified it..
What is the purpose of this script? Homework? How many lines it contains? If it is a very large file (I mean yours posted above is just an example) I'd start by splitting the file using split, so that it is far more easy to manage couples of values.
Thank you for reply.
In fact, I'm not familiar with linux at all, it's just an assignment by my boss, this is the simple case. The number of lines in real case is variable, but here, I just appreciate an awk program example from you so I may try the similar way to do something more. As you mentioned, splitting into two inputfiles might be more convenient. I did consider that but got no solution due to poor command of it. If you give me an example referring to two inputfiles it will be helpful.
What is your job, and what kinds of things are you expected to know?
Our rules and policies about homework can logically also apply to helping you with your job assignments-----If you are expected to know how to do certain things, we will be doing you a disservice by doing them for you. If you are going to get more assignments like this, then we need to help you learn ALL of the relevant tools.
SO....please tell us more about what kind of work you are doing...and more about the context of this particular question.
What is your job, and what kinds of things are you expected to know?
Our rules and policies about homework can logically also apply to helping you with your job assignments-----If you are expected to know how to do certain things, we will be doing you a disservice by doing them for you. If you are going to get more assignments like this, then we need to help you learn ALL of the relevant tools.
SO....please tell us more about what kind of work you are doing...and more about the context of this particular question.
Don't worry about it too much. it's not that serious. I'm sorry it's not an easy job to tell you the entire assignment. I just put the simple case of the trouble I met, and I do not have too much time to learn awk. So what i need is a quick start, from the example solutions you possibly give me, and i try the similar way. If other questions raise, ask again.
If any ambiguous expression occured, i apologize.
Thanks again
The ethos on LQ is to help people who have tried and got stuck or who have specific questions. There are a couple of reasons for that. Firstly questioners learn more if they try for themselves and secondly we are more inclined to spend time answering questions if the questioner has spent some time themselves.
Don't worry about it too much. it's not that serious. I'm sorry it's not an easy job to tell you the entire assignment. I just put the simple case of the trouble I met, and I do not have too much time to learn awk. So what i need is a quick start, from the example solutions you possibly give me, and i try the similar way. If other questions raise, ask again.
If any ambiguous expression occured, i apologize.
Thanks again
The way that this comes across---you simply want us to do the assignment for you.
I did not ask you to describe the entire assignment---just give us the context.
In the interests of trying to help you for the long run, I really want to know if you are in a situation where you are expected to know how to do this.
If you do not want to provide any information, that's OK---but it certainly reduces your chances of getting any help here.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.