Hi i want to compare two html files character by character and print the difference if there is any difference between two files.Thanks
use strict; use warnings; use List::Compare; use LWP::Simple; open F,"<","C:/Users/jeyakuma/Desktop/shipping project/changed co +ntents/file1.html" ; open S, "<","C:/Users/jeyakuma/Desktop/shipping project/database/fi +le2.html" ; my @a=<F>; my @b=<S>; my $lc = List::Compare->new(\@a,\@b); my @intersection = $lc->get_intersection; my @firstonly = $lc->get_unique; my @secondonly = $lc->get_complement; print "Common Items:\n"."@intersection"."\n"; print "only in file\n"."\n@firstonly"."\n"; print "only in file1 \n"."\n@secondonly"."\n";
file1
There are 2 mangoes in the basket and There are two apples in the basket
file2
They are 3 mangoes in the basket and They are six grapes in the basket
Expected output
only in file1-->2, two
only in file2-->3 six grapes
common content in both -->There are mangoes in the basket and There are apples in the basket
current result
only in file1
There are 2 mangoes in the basket and There are two apples in the basket
only in file2
They are 3 mangoes in the basket and They are six grapes in the basket
common
(blank)
In reply to compare and find difference between two files by myfrndjk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |