Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> RE: Out of topic :Compare 2 data files in unix

RE: Out of topic :Compare 2 data files in unix

From: <tjambu_fatcity_at_yahoo.com.au>
Date: Wed, 19 Jun 2002 17:08:25 -0800
Message-ID: <F001.004822A2.20020619170825@fatcity.com>


Another nice utility utility is sdiff.
It is a side by side Diff. It will concatenate the two files SIDe-BY-SIDE and have a middle column that will indicate whethere the lines are common or different or is an addition. Let me demonstrate

[111]/ora% cat A.txt
This is the 1st line
This is the 2nd line
This is the 3rd line
This is the 4th line
There is a slight difference here

[112]/ora% cat B.txt
This is the 1st line
This is the 3rd line
This is the 4th line
This is the 5th line
There is a slight differebce here

[113]/ora% sdiff A.txt B.txt

This is the 1st line                                               This is the 1st line
This is the 2nd line                                            <  
This is the 3rd line                                               This is the 3rd line
This is the 4th line                                               This is the 4th line
There is a slight difference here                               |  This is the 5th line
                                                                >  There is a slight differebce here

Options to sdiff
-w How wide you want the result window to be. If the file is 80 char wide you want it to be '-w 165'.
-s show only differences not identical lines

Warning. Make sure the files are ordered/sorted using UNIX 'sort'. Same warning goes for using 'comm'

ta
tony

At 07:43 AM 19/06/2002 -0800, you wrote:
>Hi,
>"comm" is a nice utility that works like diff. It compares 2 files and
>prints lines exclusive to file1, lines exclusive to file2 or lines common
>to both.
>
>Very useful.
>
>Regards,
>Mike Hately

 _____       ________ / ____|Tony Jambu, Database&Web Consultant
  /_  _        /_ __ /      |Wizard Consulting Pty Ltd
 /(_)/ )(_/ \_/(///(/_)/_(  |IOUG's Select Asia-Pacific Tech. Editor
 \_______/                  |EMAIL:TJambu_at_wizard.cx
----------------------------|PHONE: +61-419-TJAMBU(852628)

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: 
  INET: tjambu_fatcity_at_yahoo.com.au

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Wed Jun 19 2002 - 20:08:25 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US