Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
I have a question. In the awk command you are using awk '{print $1" "$2" "$3","$4","$5","$6","$7","$8}' where there is no " before $1 and similarly after $8. As i know awk prints the columns specififed.Can you tell me the logic here.
I have a question. In the awk command you are using awk '{print $1" "$2" "$3","$4","$5","$6","$7","$8}' where there is no " before $1 and similarly after $8. As i know awk prints the columns specififed.Can you tell me the logic here.
the " encloses the blank or the comma not the $n
but I don't know why there isn't any coma between $1 and $2 and $3
Where i am getting the timestamp somany times eventhough it was printed only once when i see in my linux machine.
PS : Just to give a brief.I am running ps command with arguments in a loop with a gap of 2 sec
You have a line every two seconds. Your Excel format shows the day, hour and minute, but not second. So you should expect the same time stamp to appear on 30 lines before going to the next time stamp.
Is that what you mean by "so many times"? What do you mean by "printed only once"?
I think you are getting confused by the fact that Excel recognizes the input as a date and time, but does not pay attention to the exact format of that date and time. So it displays it in the default format for date and time. It has stored all the details that you don't see. It just isn't displaying them.
You can click the top of the first column (to select the whole column), then right click there and select format cells, then select a different date and time format. Excel does support the same format as your original date and time. It just doesn't select that by default.
Quote:
Originally Posted by fredak
I don't know why there isn't any coma between $1 and $2 and $3
acid_kewpie guessed that the time stamp (month day time) was desired as one field, not three. So most spaces in the input delimit fields and must be replaced by "," but the first two spaces are included in the first field (what awk sees as the first three fields is what Excel should see as the first single field).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.