The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
One doubt namishtiwari Shell Programming and Scripting 2 06-30-2008 03:23 AM
doubt in awk jisha Shell Programming and Scripting 4 04-16-2008 05:02 AM
AWK doubt Rafael.Buria Shell Programming and Scripting 2 02-06-2008 11:00 AM
doubt in sed matrixmadhan UNIX for Dummies Questions & Answers 3 08-03-2005 12:34 PM
doubt it sed esham Shell Programming and Scripting 2 03-08-2005 01:52 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 10-10-2008
jisha jisha is offline
Registered User
  
 

Join Date: Jan 2008
Location: Bangalore,India
Posts: 144
Arrow Doubt in awk

Hi All,

I have two files as given below:

fileA
1234|aaaaa|vvvv
2222|bbbbbb|cbxxbjh
3333|cccc|jhjhj

fileB
3434|bbbcc|cbxxbjh
1234|cat|bullet
3333|cccc|jhjhj

I need a script that reads the first column from fileA (i.e 1234) and searches in fileB in the first parameter(i.e first column), if match found ( for example 1234 - line1 in fileA and 1234 - line 2 in fileB), then append the rest of the row in file and write to a new file

Example
Get first parameter in first row in fileA = 1234
search for the line with first parameter as 1234 in fileB.We get line 2.
write 1234|aaaaa|vvvv|cat|bullet to fileC.

Thanks in advance
JS
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:04 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0