Sponsored Content
Top Forums Shell Programming and Scripting Compare two files and print the two lines with difference Post 302327243 by kingpeejay on Saturday 20th of June 2009 10:01:10 AM
Old 06-20-2009
Compare two files and print the two lines with difference

I have two files like this:
#FILE 1
ABCD 4322 26485
JMTJ 5311 97248
XMPJ 4321 58978
#FILE 2
ABCD 4321 26485
JMTJ 5311 97248
XMPJ 4321 68978

What to do: Compare the two files and find those lines that doesn't match. And have a new file like this:
#FILE 3
"from file 1"
ABCD 4322 26485
XMPJ 4321 58978

"from file 2"
ABCD 4321 26485
XMPJ 4321 68978

many thanks!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

to compare two files and to print the difference

suppose one file P1168S P2150L P85L Q597R R1097C Another file P2150L P85L Q597R R1097C R1379C R1587K Then output shud be R1379C R1587K thanks (5 Replies)
Discussion started by: cdfd123
5 Replies

2. Shell Programming and Scripting

awk to compare lines of two files and print output on screen

hey guys, I have two files both with two columns, I have already created an awk code to ignore certain lines (e.g lines that start with 963) as they wou ld begin with a certain string, however, the rest I have added together and calculated the average. At the moment the code also displays... (3 Replies)
Discussion started by: chlfc
3 Replies

3. Shell Programming and Scripting

Compare selected columns from a file and print difference

I have learned file comparison from my previous post here. Then, it is comparing the whole line. Now, i have a new problem. I have two files with 3 columns separated with a "|". What i want to do is to compare the second and third column of file 1, and the second and third column of file 2. And... (4 Replies)
Discussion started by: kingpeejay
4 Replies

4. Shell Programming and Scripting

Compare two columns in two files and print the difference

one file . . importing table employee 119 . . importing table jobs 1 2nd file . . importing table employee 120 . . importing table jobs 1 and would like... (2 Replies)
Discussion started by: jhonnyrip
2 Replies

5. UNIX for Dummies Questions & Answers

Compare 2 files print the lines of file 2 that contain a string from file 1

Hello I am a new unix user, and I have a work related task to compare 2 files and print all of the lines in file 2 that contain a string from file 1 Note: the fields are in different columns in the files. I suspect the is a good use for awk? Thanks for your time & help File 1 123 232 W343... (6 Replies)
Discussion started by: KevinRidley
6 Replies

6. Shell Programming and Scripting

Compare multiple files and print unique lines

Hi friends, I have multiple files. For now, let's say I have two of the following style cat 1.txt cat 2.txt output.txt Please note that my files are not sorted and in the output file I need another extra column that says the file from which it is coming. I have more than 100... (19 Replies)
Discussion started by: jacobs.smith
19 Replies

7. Shell Programming and Scripting

Compare file1 for matching line in file2 and print the difference in matching lines

Hello, I have two files file 1 and file 2 each having result of a query on certain database tables and need to compare for Col1 in file1 with Col3 in file2, compare Col2 with Col4 and output the value of Col1 from File1 which is a) not present in Col3 of File2 b) value of Col2 is different from... (2 Replies)
Discussion started by: RasB15
2 Replies

8. Shell Programming and Scripting

Simple awk command to compare two files and print first difference

Hello, I have two text files, each with a single column, file 1: 124152970 123899868 123476854 54258288 123117283 file 2: 124152970 123899868 54258288 123117283 122108330 (5 Replies)
Discussion started by: LMHmedchem
5 Replies

9. Shell Programming and Scripting

Compare two variables and print the difference

Hi PRIM_SEQ=`some sql code` and output of PRIM_SEQ is like below 120 130 STB_SEQ=`some sql code` and output of STB_SEQ is like below 115 110 i need to compare this two variables output ( decimal numbers) 1) What I want to do is to compare every number in the PRIM_SEQ with... (8 Replies)
Discussion started by: amar1208
8 Replies

10. UNIX for Beginners Questions & Answers

Compare two variables and print the difference

compare two variables and print the difference i have two variables X1=rac1,rac2 Y1=rac2,rac3 output=rac1,rac3 Use code tags to wrap code fragments or data samples. (1 Reply)
Discussion started by: jhonnyrip
1 Replies
HPTIOP(4)						   BSD Kernel Interfaces Manual 						 HPTIOP(4)

NAME
hptiop -- HighPoint RocketRAID 3xxx/4xxx device driver SYNOPSIS
To compile this driver into the kernel, place the following line in your kernel configuration file: device hptiop device scbus device da Alternatively, to load the driver as a module at boot time, place the following line in loader.conf(5): hptiop_load="YES" DESCRIPTION
The hptiop driver provides support for the HighPoint RocketRAID 3xxx/4xxx series of SAS and SATA RAID controllers. HARDWARE
The hptiop driver supports the following SAS and SATA RAID controllers: o HighPoint RocketRAID 4522 o HighPoint RocketRAID 4521 o HighPoint RocketRAID 4520 o HighPoint RocketRAID 4322 o HighPoint RocketRAID 4321 o HighPoint RocketRAID 4320 o HighPoint RocketRAID 4311 o HighPoint RocketRAID 4310 o HighPoint RocketRAID 3640 o HighPoint RocketRAID 3622 o HighPoint RocketRAID 3620 The hptiop driver also supports the following SAS and SATA RAID controllers that are already End-of-Life: o HighPoint RocketRAID 4211 o HighPoint RocketRAID 4210 o HighPoint RocketRAID 3560 o HighPoint RocketRAID 3540 o HighPoint RocketRAID 3530 o HighPoint RocketRAID 3522 o HighPoint RocketRAID 3521 o HighPoint RocketRAID 3520 o HighPoint RocketRAID 3511 o HighPoint RocketRAID 3510 o HighPoint RocketRAID 3410 o HighPoint RocketRAID 3320 o HighPoint RocketRAID 3220 o HighPoint RocketRAID 3122 o HighPoint RocketRAID 3120 o HighPoint RocketRAID 3020 NOTES
The hptiop driver has only been tested on the i386 and amd64 platforms. SEE ALSO
cam(4), hptmv(4) HISTORY
The hptiop device driver first appeared in FreeBSD 7.0. AUTHORS
The hptiop driver was written by HighPoint Technologies, Inc. BSD
July 5, 2013 BSD
All times are GMT -4. The time now is 06:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy