LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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 02-12-2010, 11:44 AM   #1
arun2986
LQ Newbie
 
Registered: Feb 2010
Posts: 1

Rep: Reputation: 0
Smile Need help on accessing 2 files in awk


Need Urgent Help:

The i/p file looks like


aa 123 0 0 0
bb 123 2 1 0


A condition which has to be checked is whether character (7-8) is ' 0' and character (9-10) is ' 0'. If condition is satisfied , the first 2 characters are taken as key (for eg. 'aa' in 1 st row)
This key must be used to fetch some fields( characters 1-2 and 7-10) from the 2nd file which is of the format

aa asd 789
bb zxc 890
and write those fields alone to the 3rd file.


Can anyone please explain how the above can be accomlpished using awk command??
 
Old 02-13-2010, 04:09 AM   #2
adam999
Member
 
Registered: Sep 2006
Posts: 105

Rep: Reputation: 18
try
Code:
man awk
awk is a great tool to learn
 
0 members found this post helpful.
  


Reply

Tags
files



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
compare two files using Awk!! visitnag Linux - Newbie 3 09-15-2008 12:42 PM
AWK: compare two files haydar68 Programming 6 08-02-2008 11:20 PM
Can you use grep / awk on variables instead of files? zest n zeal Linux - Newbie 2 02-11-2008 12:37 PM
Accessing Shell variable in awk script dileepkk Linux - General 1 10-07-2004 07:47 AM
awk files alaios Linux - General 7 05-13-2003 05:56 AM

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

All times are GMT -5. The time now is 12:35 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
Open Source Consulting | Domain Registration