Compare two columns and replacing it with value from third column!!
Hi,
I am new to Unix and I am finding it hard to fix a particular logic.
The context is as below.
File 1 :
This contains of 5 fields :
File 2 :
This contains 5 fields :
I need to compare field 'Bank Code' and 'Account' of File 1 with 'Bank Code' and 'Account' of File 2.
Then I need to replace the fields 'Bank Code' and "Account' of file 1 with 'Stream Code' and 'Stream ID' of File 2.
So the final output for file 1 should be :
I am currently trying this Unix command, but its not working.
Please help me fix this issue.
Thanks in advance.
DJ
Last edited by vgersh99; 08-05-2015 at 01:18 PM..
Reason: code tags, please!
Hi.
If we have this file
A B C
7 8 9
1 2 10
and this other file
A C D F
7 9 2 3
9 2 3 4
The result i´m looking for is intersection with A B C D F
so the answer here will be (10 Replies)
Hi All,
I will really appreciate if you kindly lookinto my requirement below and provide me a solution
First file format test1.txt
qq ww rr tt ee ff
qq ww rr tt ee ff
Second file format text2.txt
aa
aa
Now o/p I want as text1.txt's 4th column replaced... (5 Replies)
Dear All,
I am new to this forum and please ignore my little knowledge :p
I have two types of data (a subset is given below)
data version 1:
439798 2 1
451209 1 2
508696 2 1
555760 2 1
582757 1 2
582889 1 2
691827... (2 Replies)
Hello everyone,
I searched the forum looking for answers to this but I could not pinpoint exactly what I need as I keep having trouble.
I have many files each having two columns and hundreds of rows.
first column is a string (can have many words) and the second column is a number.The files are... (5 Replies)
Hi all, I'm pretty much a newbie to UNIX. I would appreciate any help with UNIX coding on comparing two large csv files (greater than 10 GB in size), and output a file with matching columns.
I want to compare file1 and file2 by 'id' and 'chain' columns, then extract exact matching rows'... (5 Replies)
Hi guys, looking for some help with a way to compare data in two files but with some conditions.
example,
File 1 consists of
site1,10.1.1.1
site2,20.2.2.2
site3,30.3.3.3
File 2 contains
site1,l0.1.1.1
site2,50.1.1.1
site3,30.3.3.3
site4,40.1.1.1
I want to be able to match the... (1 Reply)
Example:
I have files in below format
file 1:
zxc,133,joe@example.com
cst,222,xyz@example1.com
File 2 Contains:
hxd
hcd
jws
zxc
cst
File 1 has 50000 lines and file 2 has around 30000 lines :
Expected Output has to be :
hxd
hcd
jws (5 Replies)
Hello Team,
My source data (INput) is like below
EPIC1 router EPIC2 Targetdefinition
Exp1 Expres rtr1 Router
SQL SrcQual Exp1 Expres
rtr1 Router EPIC1 Targetdefinition
My output like
SQL SrcQual Exp1 Expres
Exp1 Expres rtr1 Router
rtr1 Router EPIC1 Targetdefinition... (5 Replies)
Discussion started by: sekhar.lsb
5 Replies
LEARN ABOUT REDHAT
xmcvtxmstringtobytestream
XmCvtXmStringToByteStream(library call) XmCvtXmStringToByteStream(library call)
NAME
XmCvtXmStringToByteStream -- A compound string function that converts a compound string to a Byte Stream format
SYNOPSIS
#include <Xm/Xm.h>
unsigned int XmCvtXmStringToByteStream(
XmString string,
unsigned char **prop_return);
DESCRIPTION
XmCvtXmStringToByteStream converts a compound string to a string of bytes representing the compound string in Byte Stream format. This
routine is typically used by the source of a data transfer operation to produce a Byte Stream representation for transferring a compound
string to a destination.
If prop_return is not NULL, this function creates a string of characters in Byte Stream format and returns it in prop_return. The function
also returns the number of bytes in prop_return. If prop_return is NULL, the function does not return the Byte Stream format string, but
it does calculate and return the number of bytes that would appear in the Byte Stream format string.
string Specifies a compound string to be converted to Byte Stream format
prop_return
Specifies a pointer to a string in Byte Stream format that is created and returned by this function. If prop_return is NULL, no
Byte Stream format string is returned. When a Byte Stream format string is returned, the function allocates space to hold it.
The application is responsible for managing this allocated space. The application can recover the allocated space by calling
XtFree.
RETURN
Returns the number of bytes in the Byte Stream representation (whether or not the Byte Stream representation is returned).
RELATED XmString(3) and XmCvtByteStreamToXmString(3).
XmCvtXmStringToByteStream(library call)