LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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


Closed Thread
  Search this Thread
Old 01-24-2009, 02:46 PM   #1
hot bird
LQ Newbie
 
Registered: Jan 2009
Posts: 1

Rep: Reputation: 0
sed and awk command


Hi all

I have file formatting as this
name is D1
tall is ...
weight is ...
hair long is ...

n1 n2 n3 n4
.. .. .. ..
.. .. .. ..
.. .. .. ..
.. .. .. ..


name is D2
tall is ...
weight is ...
hair long is ...

n1 n2 n3 n4
.. .. .. ..
.. .. .. ..
.. .. .. ..
.. .. .. ..

and same data for person D3, D4, ..
It is a huge file. I want to use sed and awk command to print only the numbers of n3 and tall and put them in coloumns, the numbers of n3 must be in the first column. Pleeeeeeeeeeeeeese don't view it without help me.
Thanks alot
 
Old 01-25-2009, 11:19 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Welcome to LQ,

And is this a homework question? The data looks a
bit fabricated ...


Cheers,
Tink
 
Old 01-25-2009, 11:26 AM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Please post a sample of the actual file contents, and a sample of what you want the output to look like.

Also post what solutions you have already tried, and what the issues are.

Finally, does the assignment tell you specifically to use SED and AWK?
 
Old 01-26-2009, 10:58 AM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
No answer from OP means that this was likely homework.......closed.

hot_bird; If I'm wrong, send private e-mail and I'll do the right thing.
 
  


Closed Thread


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
shell command using awk fields inside awk one71 Programming 6 06-26-2008 04:11 PM
Newbie SED / AWK / Regex command help request Critcho Linux - Newbie 10 03-19-2007 11:22 AM
awk and/or sed linux2man Linux - General 7 01-22-2007 10:02 AM
sed / awk command to print line number as column? johnpaulodonnell Linux - Newbie 2 01-22-2007 07:07 AM
Sed/Awk command help needed. farmerjoe Programming 3 03-02-2005 11:13 AM


All times are GMT -5. The time now is 03:42 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