Results 1 to 3 of 3
Hello everyone! I am fairly new to Linux and was needing some help on a comparing more than 2 files. I am try to come up with something that would ...
- 03-20-2010 #1Just Joined!
- Join Date
- Mar 2010
- Posts
- 1
Comparing multiple of files
Hello everyone! I am fairly new to Linux and was needing some help on a comparing more than 2 files. I am try to come up with something that would compare at least 10+ different files to a master file and give me an output of what is missing.
Example would be:
a.txt, b.txt, c.txt, d.txt compare each of them to the master.txt file, than output the missing text for each file into new file.
I came across comm and diff commands, am I looking in the right place or is there a much easier way of doing this?
Any help would be greatly appreciated!
-Rick
- 03-24-2010 #2
I think you would need to compare them one at a time,
like
a.txt and master.txt
and write them into new file
now check
b.txt with master.txt and so on..
To compare files I normally use Kompare- Lakshmipathi.G
-------------------
FOSS India Award winning ext3fs Undelete tool and tutorials www.giis.co.in
First they criticize you,Then they laugh at you,Then they fight with you,Then you win. - M.K.Gandhi
-------------------
- 03-24-2010 #3
You could write a bash script to do it. The file names would be your arguments. Then you would need a loop something like:
Code:for filename in $* do diff filename master.txt>>logfile done
"I'm just a little old lady; don't try to dazzle me with jargon!"


Reply With Quote