hi, plz tel me how two compare a two files in perl, Ignore whitespace only compare the written satements.....
13 3365
What have you tried so far?
What have you tried so far?
i writtn a code for comparing a two files, it comparing whitespace also, i dont want to whitespace also, only writtn satatements
Post the code you have written.
-
use File::DirCompare;
-
-
# Simple diff -r --brief replacement
-
use File::Basename;
-
$dir1 = shift;
-
$dir2 = shift;
-
-
# print "Directories to be searched are $dir1 $dir2 \n";
-
-
open APPEND_VSS_UNIQUE_FILE, ">>/perl/test/unique_VSS.txt" or die "Cannot Open File: $!";
-
open APPEND_PERFORCE_UNIQUE_FILE, ">>/perl/test/unique_Perforce.txt" or die "Cannot Open File: $!";
-
open APPEND_COMMON_DIFFERENT_FILE, ">>/perl/test/common_different_VSSAndPerforce.txt" or die"Cannot Open File: $!";
-
open APPEND_COMMON_SIMILAR_FILE, ">>/perl/test/common_similar_VSSAndPerforce.txt" or die "Cannot Open File: $!";
-
-
File::DirCompare->compare($dir1, $dir2, sub {
-
my ($a, $b, $fg) = @_;
-
if (! $b) {
-
print APPEND_VSS_UNIQUE_FILE $a, "\n";
-
# printf "Files unique Only in $dir1: %s\n", basename($a);
-
print "Files unique Only in $dir1: $a \n";
-
-
} elsif (! $a) {
-
print APPEND_PERFORCE_UNIQUE_FILE $b, "\n";
-
# printf "Files unique Only in $dir2: %s\n", basename($b);
-
print "Files unique Only in $dir2: $b \n";
-
-
} elsif($fg == 1) {
-
print APPEND_COMMON_DIFFERENT_FILE "$a\||$b\n";
-
print "Files $a and $b are common and different\n";
-
-
} elsif($fg == 0) {
-
print APPEND_COMMON_SIMILAR_FILE "$a\||$b\n";
-
print "Files $a and $b are common and similar\n";
-
}
-
});
-
-
close APPEND_VSS_UNIQUE_FILE;
-
close APPEND_PERFORCE_UNIQUE_FILE;
-
close APPEND_COMMON_DIFFERENT_FILE;
-
close APPEND_COMMON_SIMILAR_FILE;
-
hehehe... you and your clone have fun, I see you don't really need any help, your just entertaining yourself. Sort of like forum masturbation I guess. :)
hehehe... you and your clone have fun, I see you don't really need any help, your just entertaining yourself. Sort of like forum masturbation I guess. :)
pls sir, am not jocking... plzzzzz -
use File::DirCompare;
-
-
# Simple diff -r --brief replacement
-
use File::Basename;
-
$dir1 = shift;
-
$dir2 = shift;
-
-
# print "Directories to be searched are $dir1 $dir2 \n";
-
-
open APPEND_VSS_UNIQUE_FILE, ">>/perl/test/unique_VSS.txt" or die "Cannot Open File: $!";
-
open APPEND_PERFORCE_UNIQUE_FILE, ">>/perl/test/unique_Perforce.txt" or die "Cannot Open File: $!";
-
open APPEND_COMMON_DIFFERENT_FILE, ">>/perl/test/common_different_VSSAndPerforce.txt" or die"Cannot Open File: $!";
-
open APPEND_COMMON_SIMILAR_FILE, ">>/perl/test/common_similar_VSSAndPerforce.txt" or die "Cannot Open File: $!";
-
-
File::DirCompare->compare($dir1, $dir2, sub {
-
my ($a, $b, $fg) = @_;
-
if (! $b) {
-
print APPEND_VSS_UNIQUE_FILE $a, "\n";
-
# printf "Files unique Only in $dir1: %s\n", basename($a);
-
print "Files unique Only in $dir1: $a \n";
-
-
} elsif (! $a) {
-
print APPEND_PERFORCE_UNIQUE_FILE $b, "\n";
-
# printf "Files unique Only in $dir2: %s\n", basename($b);
-
print "Files unique Only in $dir2: $b \n";
-
-
} elsif($fg == 1) {
-
print APPEND_COMMON_DIFFERENT_FILE "$a\||$b\n";
-
print "Files $a and $b are common and different\n";
-
-
} elsif($fg == 0) {
-
print APPEND_COMMON_SIMILAR_FILE "$a\||$b\n";
-
print "Files $a and $b are common and similar\n";
-
}
-
});
-
-
close APPEND_VSS_UNIQUE_FILE;
-
close APPEND_PERFORCE_UNIQUE_FILE;
-
close APPEND_COMMON_DIFFERENT_FILE;
-
close APPEND_COMMON_SIMILAR_FILE;
-
hehehe... you and your clone have fun, I see you don't really need any help, your just entertaining yourself. Sort of like forum masturbation I guess. :)
Hehe. This joke is actually rather funny. I went ahead and reformatted the code to make it potentially useful for someone else, but I suspect that this is possibly just the module author given that it's only in version .02. cpan File DirCompare
Anyway, I deleted the other thread as a duplicate post. That makes it a night for me.
Twinkle Twinkle...
- Miller
pls sir, am not jocking... plzzzzz -
use File::DirCompare;
-
-
# Simple diff -r --brief replacement
-
use File::Basename;
-
$dir1 = shift;
-
$dir2 = shift;
-
-
# print "Directories to be searched are $dir1 $dir2 \n";
-
-
open APPEND_VSS_UNIQUE_FILE, ">>/perl/test/unique_VSS.txt" or die "Cannot Open File: $!";
-
open APPEND_PERFORCE_UNIQUE_FILE, ">>/perl/test/unique_Perforce.txt" or die "Cannot Open File: $!";
-
open APPEND_COMMON_DIFFERENT_FILE, ">>/perl/test/common_different_VSSAndPerforce.txt" or die"Cannot Open File: $!";
-
open APPEND_COMMON_SIMILAR_FILE, ">>/perl/test/common_similar_VSSAndPerforce.txt" or die "Cannot Open File: $!";
-
-
File::DirCompare->compare($dir1, $dir2, sub {
-
my ($a, $b, $fg) = @_;
-
if (! $b) {
-
print APPEND_VSS_UNIQUE_FILE $a, "\n";
-
# printf "Files unique Only in $dir1: %s\n", basename($a);
-
print "Files unique Only in $dir1: $a \n";
-
-
} elsif (! $a) {
-
print APPEND_PERFORCE_UNIQUE_FILE $b, "\n";
-
# printf "Files unique Only in $dir2: %s\n", basename($b);
-
print "Files unique Only in $dir2: $b \n";
-
-
} elsif($fg == 1) {
-
print APPEND_COMMON_DIFFERENT_FILE "$a\||$b\n";
-
print "Files $a and $b are common and different\n";
-
-
} elsif($fg == 0) {
-
print APPEND_COMMON_SIMILAR_FILE "$a\||$b\n";
-
print "Files $a and $b are common and similar\n";
-
}
-
});
-
-
close APPEND_VSS_UNIQUE_FILE;
-
close APPEND_PERFORCE_UNIQUE_FILE;
-
close APPEND_COMMON_DIFFERENT_FILE;
-
close APPEND_COMMON_SIMILAR_FILE;
-
ok sir dont help....
hi, plz tel me how two compare a two files in perl, Ignore whitespace only compare the written satements.....
arne 315
Expert 100+
hi, plz tel me how two compare a two files in perl, Ignore whitespace only compare the written satements.....
Does File::Compare do what you need?
ok sir, dont help
Do you really need help? Why are you posting with different usernames and answering your own question? If you really need help, fine, if not, stop wasting your time and our time.
Sign in to post your reply or Sign up for a free account.
|