03-06-2009
compare line in two files
Dear All
i want to compate two diff file line by line. Kindly help me.
file 1:
1;givi;01012000;wer
2;sss;02012000;rrr
3;ccc;03012000;ttt
file 2:
0;uuu;01012000;lll
1;givi;01012000;wer
2;sss;02012000;rrr
3;ccc;03012000;ttt
5;givi;01012000;hhh
Output1: comman line to both file
1;givi;01012000;wer
2;sss;02012000;rrr
3;ccc;03012000;ttt
Outpu2: line only in file 1
4:ddd;03022000;ppp
output3: line only in file 2
0;uuu;01012000;lll
5;givi;01012000;hhh
kindly help in all way.
thx in advance
rgd
jaydeep
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have 3 file, each of has got 80000 records.
file1.txt
-----------------------
ABC001;active;modify;accept;
ABC002;notactive;modify;accept;
ABC003;notactive;no-modify;accept;
ABC004;active;modify;accept;
ABC005;active;no-modify;accept;
file2.txt
---------------------------... (8 Replies)
Discussion started by: ganesh_mak
8 Replies
2. Shell Programming and Scripting
Hi all
I need help on comparing two texts files line by line and print the total number of lines matched. Any help is appreciated. Thanks in advance. (4 Replies)
Discussion started by: my_Perl
4 Replies
3. Shell Programming and Scripting
Query:
There are two files as below -
/home/rgupta/input/file.txt.arch (source file)
/home/rgupta/output/file.txt (destination file)
Files details are attached for the reference.
Scenario:
File /home/rgupta/input/file.txt.arch picked up by an application xyz. Application xyz does... (2 Replies)
Discussion started by: ravigupta2u
2 Replies
4. Shell Programming and Scripting
Hi, Unix Gurus:
I have a requirement which need to compare the first line of two files.
e.g;
file1
123
abc
def
file2
123
abcdef
defe
I need compare first line: in two file: in this case, two file contain same value in first line (123)
anybody can help me.
Thanks in advance (2 Replies)
Discussion started by: ken002
2 Replies
5. Shell Programming and Scripting
Using diff to compare 2 files
FILE1:
AAA
AAA
AAA
AAA
AAA
AAA
FILE2:
BBB
BBB
AAA
AAA
BBB
BBB
diff FILE1 FILE2 (3 Replies)
Discussion started by: yannsun
3 Replies
6. Shell Programming and Scripting
Hi All,
I'm trying to figure out which are the trusted-ips and which are not using a script file.. I have a file named 'ip-list.txt' which contains some ip addresses and another file named 'trusted-ip-list.txt' which also contains some ip addresses. I want to read a line from... (4 Replies)
Discussion started by: mjavalkar
4 Replies
7. Shell Programming and Scripting
I have two files, "ranked.txt" and "sorted.txt". Sorted.txt is a smaller subset from ranked.txt that is sorted in alpha order. However ranked.txt preserves the ranking of words I would like to keep.
How do I check the rank of every word in sorted.txt when matched to the original ranked.txt? I... (8 Replies)
Discussion started by: pxalpine
8 Replies
8. Shell Programming and Scripting
Hi Experts,
Would really appreciate if anyone can guide me how to compare two pdf files line by line and report the difference to another file. (3 Replies)
Discussion started by: prasanth_babu
3 Replies
9. Shell Programming and Scripting
I am new to awk scripting.
I want to do a field by word (field) comparison of two files File1.txt and File2.txt.
The files contain a list of | (pipe) separated field.
**File 1:
-------------------
aaa|bbb|ccc|eee|fff
lll|mmm|nnn|ooo|ppp
rrr|sss|ttt|uuu|vvv**
File 2: ... (7 Replies)
Discussion started by: dhruvmohan
7 Replies
10. UNIX for Beginners Questions & Answers
Hello All!
Thanks for taking time out and helping.
My issue is, I have two files that have file names in it. Now, i need to go through each line of both the files and when the file names are different, i need to rename the file. Below is the example:
File1</
fil1ename1.txt
filename2,txt... (2 Replies)
Discussion started by: svks1985
2 Replies
LEARN ABOUT DEBIAN
slack-diff
DIFF(1) User Commands DIFF(1)
NAME
slack-diff - compare file contents, modes, etc
SYNOPSIS
slack-diff [OPTION]... FILE1 FILE2
DESCRIPTION
A wrapper for diff that displays file modes and other metadata changes.
-u -U NUM --unified[=NUM]
Tell diff(1) to use unified output format.
--diff PROG
Use this program for diffing, instead of diff.
--fakediff
Make a fake diff for file modes and other things that are not file contents. Default is on, can be disabled with --nofakediff.
-r --recursive
Recursively compare any subdirectories found.
-N --new-file
Treat missing files as empty. Default is on, can be disabled with --nonew-file.
--unidirectional-new-file
Treat only missing files in the first directory as empty.
--from-file
Treat arguments as a list of files from which to read filenames to compare, two lines at a time.
-0 --null
Use NULLs instead of newlines as the separator in --from-file mode.
--devnullhack
You have a version of diff that can't deal with -N when not in recursive mode, so we need to feed it /dev/null instead of the miss-
ing file. Default is on, can be disabled with --nodevnullhack.
--version
Output version info.
--help Output this help.
FILES are `FILE1 FILE2' or `DIR1 DIR2' or `DIR FILE...' or `FILE... DIR'. If --from-file or --to-file is given, there are no restrictions
on FILES. If a FILE is `-', read standard input.
SEE ALSO
diff(1)
diffutils 2.8.1 April 2002 DIFF(1)