Compare multiple files with multiple number of columns
Hi,
input file1
input file2
I want to match the first four columns of my file1 to the first four columns of file2, and if there is any match, I want the records from input file2. So, now my output would be
output
Last edited by jacobs.smith; 06-27-2012 at 04:42 PM..
Hi there,
I was wondering if someone can help me with this.
I am trying the combine multiple columns from multiple files into one file.
Example file 1:
c0t0d0 c0t2d0 # hostname vgname
c0t0d1 c0t2d1 # hostname vgname
c0t0d2 c0t2d2 # hostname vgname
c0t1d0 c0t3d0 # hostname vgname1... (5 Replies)
I get the point of number subtraction in one column
awk 'NR==1 {n=$1; next}; {n-=$1} END {print n}' inputfile
but I cannot figure it out how to do this to multiple
columns.
awkward. (6 Replies)
hello,
I will would be grateful if anyone can help me reply to my post
extract multiple cloumns from multiple files; skip rows and include filenames; awk
Please see this thread.
Thanks
manishabh (0 Replies)
Hi,
I need to compare multiple columns from 2 files.
I can, for example, have these 2 files:
file1:
col1, col2, col3,col4
a,1,4,7
b,2,5,8
c,3,6,9file2:
col1, col2, col3,col4
a,2,3,2
b,5,7,5
c,1,9,8As a result, I need for example the difference between the columns 2 and 4:
col2,... (3 Replies)
Hi guys,
I have very basic linux experience so I need some help with a problem.
I have 3 files from which I want to extract columns based on common fields between them.
File1:
--- rs74078040 NA 51288690 T G 461652 0.99223 0.53611 3
--- rs77209296 NA 51303525 T G 461843 0.98973 0.60837 3... (10 Replies)
Hi,
I have multiple files that each contain one column of strings:
File1:
123abc
456def
789ghi
File2:
123abc
456def
891jkl
File3:
234mno
123abc
456def
In total I have 25 of these type of file. (5 Replies)
Hello guys, I am quite new to Shell Scripting and I need help for this
I have a CSV file like this:
Requisition,Order,RequisitionLineNumber,OrderLineNumber
REQ1,Order1,1,1
REQ1,Order1,1,3
REQ2,Order2,1,5
Basically what I want to do is compare the first 3 fields
If all 3 fields are the same... (5 Replies)
Hello Gurus,
I have a multiple pipe separated files which have records going over multiple Lines. End of line separator is \n and records going over multiple lines have <CR> as separator. below is example from one file.
1|ABC DEF|100|10
2|PQ
RS
T|200|20
3| UVWXYZ|300|30
4| GHIJKL|400|40... (7 Replies)
Discussion started by: dJHa
7 Replies
LEARN ABOUT ULTRIX
cmp
cmp(1) General Commands Manual cmp(1)Name
cmp - compare two files
Syntax
cmp [-l | -s] file1 file2 [ skip1 ] [ skip2 ]
Description
The command compares two files. If either file1 or file2 is `-', standard input is used for the file. With no options, makes no comment
if the files are the same. If they differ, it reports the byte and line number at which the difference occurred to standard output. If
one file is an initial subsequence of the other a message including the file name is written to standard error.
The optional skip1 and skip2 parameters are initial byte offsets into file1 and file2 respectively and may be either octal, by specifying a
leading 0, or decimal. When using skip1 and skip2 the offset is treated as the start of the respective input file. Only one option may be
specified at a time. Only one of the input files may be standard input at a time. Because the line number is not calculated when using
either of the options the use of either flag will increase the speed of
Options-l Long format: prints the byte number (decimal) and the differing bytes (octal) for each difference.
-s Suppresses normal output and sets the exit code only.
Diagnostics
Exit code 0 is returned for identical files, 1 for different files, and 2 for an inaccessible or missing argument.
See Alsocomm(1), diff(1)cmp(1)