LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 01-28-2014, 08:52 PM   #16
tabbygirl1990
Member
 
Registered: Jul 2013
Location: a warm beach, cool ocean breeze, nice waves, and a Margaritta
Distribution: RHEL 5.5 Tikanga
Posts: 63

Original Poster
Rep: Reputation: 1

and i'm even able to use a printf statement - yea

john_vv - i'll check it out, i know python is a more modern scripting lingo than awk, thanks!

luv ya all, ciao

tabby
 
Old 01-29-2014, 12:35 AM   #17
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,515

Rep: Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892
Well it is not a course but my reference bible and what I initially used to learn is:

http://www.gnu.org/software/gawk/man...ode/index.html

I just started from the beginning and used the examples to learn how different parts work.

Also, should you want / need the date and time value, you can alter colucix's (I had to make some other changes as example seems to print all data together) example easily enough:
Code:
awk -vi=6 '{if(!(NR%7))i+=7;ORS = (NR%i?",":RS)}NF{ print (NF == 5?$(NF-2)" ":"") $(NF-1)}' file
 
Old 01-29-2014, 09:08 AM   #18
tabbygirl1990
Member
 
Registered: Jul 2013
Location: a warm beach, cool ocean breeze, nice waves, and a Margaritta
Distribution: RHEL 5.5 Tikanga
Posts: 63

Original Poster
Rep: Reputation: 1
grail, thanks soooo much

tabby
 
Old 01-29-2014, 09:33 AM   #19
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,515

Rep: Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892Reputation: 2892
Seems my brain was in sleepy time before and so picked the hard way ... let us try:
Code:
awk 'NF{ORS = (NR+1)%7?",":RS;print (NF == 5?$(NF-2)" ":"") $(NF-1)}' file
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] reading column data from multiple files and find average vjramana Programming 4 11-07-2012 10:53 AM
[SOLVED] Match codes in first column in 2 files and return data in other columns cgcamal Programming 12 09-30-2011 01:03 AM
PHP: storing all data form a db row in variables with the same name as the db column konqi Programming 2 07-10-2008 05:13 AM
how to get the second column and first row data from a file??? loplayers Linux - Newbie 3 11-05-2007 07:35 PM
changing data or files into .iso!! justsimran Linux - Networking 4 03-07-2007 12:38 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:30 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration