06-24-2010
compare the similar files
I got many pair files, which only have small difference, such as more space, or more empty line, and some unreadable characters.
If list by commend "diff", I can see many many difference.
So I'd like to write a script to compare the pair files, if 95% contents are same, I will think they are similar.
Any suggestion for it?
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I would like to know how to compare a listing of directories that begin with the same four numbers ie.
/1234cat
/1234tree
/1234fish
and move all these directories into one directory
Thanks in advance (2 Replies)
Discussion started by: tgibson2
2 Replies
2. Shell Programming and Scripting
Hi,
I have two text files.The first and the 2nd file have data in the same format
For e.g. The first file has
table_name1 column1 sum(column1) max(column1) min(column1)
table_name1 column2 sum(column2) max(column2) min(column2)
table_name1 coulmn3 sum(column3) max(column3) min(column3)
... (13 Replies)
Discussion started by: ragavhere
13 Replies
3. Shell Programming and Scripting
I have four files, I need to compare these files together.
As such i know "sdiff and comm" commands but these commands compare 2 files together. If I use sdiff command then i have to compare each file with other which will increase the codes.
Please suggest if you know some commands whcih can... (6 Replies)
Discussion started by: nehashine
6 Replies
4. Shell Programming and Scripting
Hi,
I am new in unix.
I have below requirement:
I have two files at the same directory location
File1.txt and File2.txt (just an example, real scenario we might have File2 and File3 OR File6 and File7....)
File1.txt has :
header1
record1
trailer1
File2.txt has:
header2
record2... (4 Replies)
Discussion started by: Deepak62828r
4 Replies
5. Shell Programming and Scripting
Hello all,
I have a server that is running AIX, running a tool that converts various printstreams (AFP/Metadata) to PDF. This is done using a rexx script and an off the shelf utility.
Each report (there's around 125) uses a certain script file, it's basically a text file.
I am trying... (5 Replies)
Discussion started by: jeffs42885
5 Replies
6. UNIX for Dummies Questions & Answers
Hi,
I have a file1 like this:
ABAT
ABCA1
ABCC1
ABCC5
ABCC8
ABCE1
ABHD2
ABL1
CAMTA1
ACBD3
ACCN1
And I have a second file like this:
chr19 46118590 46119564 MACS_peak_1499 3100.00 chr19 46122009 46148405 CYP2B7P1 -2445
chr1 7430312 7430990... (7 Replies)
Discussion started by: a_bahreini
7 Replies
7. Shell Programming and Scripting
{
"AFafa": "FAFA","AFafa": "FAFA"
"baseball":"soccer","wrestling":"dancing"
"rhinos":"crocodiles","roles":"foodchain"
}
I need to insert a new line before the closing brackets "}" so that the final output looks like this:
{
"AFafa": "FAFA","AFafa": "FAFA"... (6 Replies)
Discussion started by: SkySmart
6 Replies
8. Solaris
Hi,
I need to compare the /etc/passwd files from 2 servers, and extract the users that are similar in these two files. I sorted the 2 files based on the user IDs (UID) (3rd column). I first sorted the files using the username (1st column), however when I use comm to compare the files there is no... (1 Reply)
Discussion started by: anaigini45
1 Replies
9. UNIX for Beginners Questions & Answers
Hi,
I want to compare same column in two files, if values match then display the column or display "NA".
Ex :
File 1 :
123
abc
xyz
pqr
File 2:
122
aab
fdf
pqr
fff
qqq
rrr (1 Reply)
Discussion started by: hkoshekay
1 Replies
10. UNIX for Beginners Questions & Answers
Hi all,
This is my first day on Linux shell!!!
So, I am trying to write a script that that will pick up pairs of files with the same name (not the same content) but that are different in one character (one is *R1 the other is *R2)...
Something like: look ate the files, whenever they are the... (3 Replies)
Discussion started by: ALou
3 Replies
vdiff(1) ShapeTools vdiff(1)
NAME
vdiff - display line-by-line differences between versions of files
SYNOPSIS
vdiff [ diff-options ] [ -base path ] [ -P ] files ..
DESCRIPTION
vdiff is a differential comparator for file versions that are stored in shapeTools' object base, AtFS. The functionality of vdiff is very
similar to the diff command on your host. All options and switches that are recognized by diff can also be specified for vdiff.
The arguments to vdiff can either be a single filename, or a pair of version identifiers. If only a filename is specified, vdiff prints the
differences between the specified file and the most recent version of this file that is stored in the AtFS object base. A file can be com-
pared to any stored version by specifying the version as first, and the filename as second argument. If both arguments are version identi-
fiers, the difference between these two versions is printed.
Differences between files and versions can be printed in any style that is supported by the local diff program.
Version identifiers consist of the filename, and a version number or alias name for a version, enclosed in brackets. Example:
retrieve.c[4.22] or retrieve.c[Rel-4.1]
vdiff creates temporary copies of the versions that shall be compared, invokes the diff command, and finally removes the temporary copies.
OPTIONS
-base path
If vdiff is told to produce a context diff, the filenames of the compared objects are mangeled so that the specified path replaces
the path of the current directory in the full pathnames appearing in the diff-header. This is useful to replace an absolute pathname
by a relative pathname and makes the produced context-diff easier to digest for the patch program.
-P With the -P switch turned on, vdiff won't give up if one of the two objects that shall be compared does not exist. In this case an
empty object is substituted for the missing one, causing the diff to be the complete contents of the existing object. This is useful
in situations when complex patches are produced that upgrade one release of a software system to a new release, and the system has
structurally changed (i.e. new files have been added to the system).
SEE ALSO
diff(1), vcat(1)
AUTHOR
Axel.Mahler@cs.tu-berlin.de
vc_scripts-2.5 Tue Jun 29 16:42:06 1993 vdiff(1)