help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-bash] split and substitute


From: Val Krem
Subject: [Help-bash] split and substitute
Date: Sat, 11 Jun 2016 01:55:59 +0000 (UTC)

Hi all,

I have two data sets (my data set and  reference file)

File1 is the file that I have with two fields (x1 and x2)

x1   x2  
A123    bC32
A124    bC34
A125    bC35
A126    bC36
A127    NC37


File2 is the reference file with two fields (y1 and y2). 
y1    y2
A123    bC32
A124    bC34
A125    dC35
R126    bC36
A128    bC38

I want merge the two files by  x2 and y2. 

If x2 and y2  are equal and x1 and y1 are not equal, I want substitute x1 by y1 
 and create file3  an example is shown below. Substituting x1 by y1 is a bit 
tricky.

file3
A123    bC32
A124    bC34
R126    bC36

File4 will be unmatched records by x2 and y2.

A127    NC37



Thank you in advance


reply via email to

[Prev in Thread] Current Thread [Next in Thread]