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
Search, replace string in file1 with string from (lookup table) file2? gstuart Shell Programming and Scripting 9 06-08-2009 07:11 AM
Matching string nehaquick UNIX for Dummies Questions & Answers 7 02-19-2008 11:51 AM
String matching question Katkota Shell Programming and Scripting 6 10-22-2007 01:28 PM
String matching mpang_ Shell Programming and Scripting 3 07-28-2006 06:45 AM
sed problem - replacement string should be same length as matching string. amangeles Shell Programming and Scripting 4 01-11-2006 06:11 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 06-19-2008
Nayanajith Nayanajith is offline
Registered User
  
 

Join Date: Nov 2005
Posts: 27
Lookup the matching string

Dear all,

I have two files like below.

file1
======

x y
==== ===
123 test1
124 test2
125 test3

file2
=======

a b c
=== === ====
123 361123 662661
1021 1222530 5960577
125 598097 1094666
27073 1309791 5797483
124 278967 4424643

if the "a" column of file2 matching with "x" column of file1
so i want to replace "a" column value of file2 with the "y" column of the file1s .


like below,

a b c
=== === ====
test1 361123 662661
1021 1222530 5960577
test3 598097 1094666
27073 1309791 5797483
test2 278967 4424643

please help to do it.

Thanks you.
 

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 06:13 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