943,172 Members | Top Members by Rank

Ad:
  • Perl Discussion Thread
  • Marked Solved
  • Views: 82
  • Perl RSS
You are currently viewing page 1 of this multi-page discussion thread
Sep 3rd, 2010
0

text files modules comparision

Expand Post »
Hello,

please try to help the fresher

i was a beginner in perl .but gave me critical work.

my task looks simple!But not.i was trying for 4days.


i have two text files each contain code in modules.


my task i have to take module name from the user

and search the module by module name in file.whenever module is found


i have to take the content in the module into on string


or array ,ETc


similarly i have to perform the search in 2nd file also and finally

compare the content in the modules and print the code which is different.


i can able to search upto module name.then after i can't

module looks like

(i have to search the module first upto i_MMCM_ADV then after take the contents after

brackets into dummy variable upto semilcolan(end))

for anothe i have to do the same and compare the contents


.CLKIN1_PERIOD ( 5.000000 ),
.CLKIN2_PERIOD ( 5.000000 ),
.LOC ( "MMCM_ADV_X0Y5" ),
.VCOCLK_FREQ_MAX ( 1200.000000 ),
.VCOCLK_FREQ_MIN ( 600.000000 ),
.CLKIN_FREQ_MAX ( 700.000000 ),
.CLKIN_FREQ_MIN ( 10.000000 ),
.CLKPFD_FREQ_MAX ( 450.000000 ),
.CLKPFD_FREQ_MIN ( 10.000000 ))
start i_MMCM_ADV (
.CLKFBIN(CLKFBIN),
.PSCLK(GND),
.PWRDWN(\i_MMCM_ADV/PWRDWN_INT ),
.DCLK(GND),
.DEN(GND),
.CLKINSEL(\i_MMCM_ADV/CLKINSEL_INT ),
.CLKIN2(GND),
.RST(\i_MMCM_ADV/RST_INT ),
.PSINCDEC(\i_MMCM_ADV/PSINCDEC_INT ),
.DWE(GND),
.PSEN(\i_MMCM_ADV/PSEN_INT ),
.CLKIN1(clk_IBUF_2571),
.CLKOUT3(CLKOUT3),
.CLKOUT3B(\i_MMCM_ADV/CLKOUT3B ),
.CLKFBOUT(CLKFBOUT),
.CLKFBSTOPPED(\i_MMCM_ADV/CLKFBSTOPPED ),
.CLKFBOUTB(\i_MMCM_ADV/CLKFBOUTB ),
.CLKOUT1(CLKOUT1),
.CLKOUT5(CLKOUT5),
.DRDY(\i_MMCM_ADV/DRDY ),
.CLKOUT0(clk_out0_OBUF_2333),
.CLKOUT4(CLKOUT4),
.CLKOUT1B(\i_MMCM_ADV/CLKOUT1B ),
.CLKINSTOPPED(\i_MMCM_ADV/CLKINSTOPPED ),
.CLKOUT0B(\i_MMCM_ADV/CLKOUT0B ),
.CLKOUT2(CLKOUT2),
.CLKOUT2B(\i_MMCM_ADV/CLKOUT2B ),
.PSDONE(\i_MMCM_ADV/PSDONE ),
.CLKOUT6(CLKOUT6),
.LOCKED(LOCKED_OBUF_2386),
.DI({GND, GND, GND, GND, GND, GND, GND, GND, GND, GND, GND, GND, GND, GND, GND, GND}),
.DADDR({GND, GND, GND, GND, GND, GND, GND}),
.DO({\i_MMCM_ADV/DO15 , \i_MMCM_ADV/DO14 , \i_MMCM_ADV/DO13 , \i_MMCM_ADV/DO12 , \i_MMCM_ADV/DO11 , \i_MMCM_ADV/DO10 , \i_MMCM_ADV/DO9 ,
\i_MMCM_ADV/DO8 , \i_MMCM_ADV/DO7 , \i_MMCM_ADV/DO6 , \i_MMCM_ADV/DO5 , \i_MMCM_ADV/DO4 , \i_MMCM_ADV/DO3 , \i_MMCM_ADV/DO2 , \i_MMCM_ADV/DO1 ,
\i_MMCM_ADV/DO0 })
); END
X_SRLC16E #(
.LOC ( "SLICE_X0Y102" ),
.INIT ( 16'h0000 ))
\dsync_r6/Mshreg_dout_0 (
.A0(1'b0),
.A1(1'b0),
.A2(1'b0),
.A3(1'b0),
.CLK(\NlwBufferSignal_dsync_r6/Mshreg_dout_0/CLK ),
.D(r6[0]),
.Q15(\NLW_dsync_r6/Mshreg_dout_0_Q15_UNCONNECTED ),
.Q(\dsync_r6/Mshreg_dout_0_303 ),
.CE(1'b1)
Attached Files
File Type: txt 1.txt (2.7 KB, 21 views)
File Type: txt 2.txt (2.0 KB, 22 views)
Last edited by koduruabhinav; Sep 3rd, 2010 at 10:05 am.
Similar Threads
Reputation Points: 12
Solved Threads: 0
Light Poster
koduruabhinav is offline Offline
43 posts
since Jan 2010
Sep 3rd, 2010
0
Re: text files modules comparision
The first part, storing the contents of the files into string variables and then extracting the module code from each into two string variables:
Perl Syntax (Toggle Plain Text)
  1. #!/usr/bin/perl
  2. #extract_mods_to_strings.pl
  3. use strict;
  4. use warnings;
  5. my $dir = '/home/david/Programming/Perl/data';
  6. my $filename1 = '1.txt';
  7. my $filename2 = '2.txt';
  8.  
  9. #The following way of 'slurping' files into strings adapted from
  10. # http://www.perlmonks.org/?node_id=287647
  11.  
  12. my $string1 = do {
  13. local $/;
  14. open my $handle1,'<',"$dir/$filename1" or die "open of $dir/$filename1 failed: $!\n";
  15. <$handle1>;
  16. }; # $string1 now contains contents of 1.txt
  17.  
  18. my $string2 = do {
  19. local $/;
  20. open my $handle2,'<',"$dir/$filename2" or die "open of $dir/$filename2 failed: $!\n";
  21. <$handle2>;
  22. }; # $string2 now contains contents of 2.txt
  23.  
  24. $string1 =~ /i_MMCM_ADV \((.*)\);/s;
  25. my $modcode_from_1 = $1;
  26.  
  27. $string2 =~ /i_MMCM_ADV \((.*)\);/s;
  28. my $modcode_from_2 = $1;
  29.  
  30. print "Here is the module code from $filename1---------------------:\n";
  31. print $modcode_from_1;
  32. print "\n\n";
  33. print "Here is the module code from $filename2---------------------:\n";
  34. print $modcode_from_2;
I don't know how the comparison should be done and what constitutes a unit of code to compare and print.
Reputation Points: 153
Solved Threads: 140
Master Poster
d5e5 is offline Offline
735 posts
since Sep 2009
Sep 4th, 2010
0
Re: text files modules comparision
Hi,

code is working but problem is

i was getting code after the module also i.e after semicolan also.

i want get code upto first semicolan only.
(i_MMCM_ADV/DO0)

then after i should comapare the strings and print the differences.

please make the changes please try to solve me
Reputation Points: 12
Solved Threads: 0
Light Poster
koduruabhinav is offline Offline
43 posts
since Jan 2010
Sep 4th, 2010
1
Re: text files modules comparision
Perl Syntax (Toggle Plain Text)
  1. #!/usr/bin/perl
  2. #compare_files.pl
  3. use strict;
  4. use warnings;
  5. my $dir = '/home/david/Programming/Perl/data';
  6. my $filename1 = '1.txt';
  7. my $filename2 = '2.txt';
  8.  
  9. sub slurp_file {
  10. #This subroutine takes the path and filename of an input file
  11. # and returns a filehandle referencing the entire contents.
  12. my ($dir,$file) = @_;
  13. local $/;
  14. open my $fh,'<',"$dir/$file" or die "open of $dir/$file failed: $!\n";
  15. <$fh>;
  16. };
  17.  
  18. my $string1 = slurp_file($dir, $filename1); # $string1 now contains contents of 1.txt
  19.  
  20. my $string2 = slurp_file($dir, $filename2); # $string2 now contains contents of 2.txt
  21.  
  22. $string1 =~ /i_MMCM_ADV \(([^;]*)\);/s;
  23. my $modcode_from_1 = $1;
  24. undef $string1; #Don't need $string1 any more.
  25. $modcode_from_1 =~ s/[[:cntrl:]]//gm; #Remove control characters
  26.  
  27. $string2 =~ /i_MMCM_ADV \(([^;]*)\);/s;
  28. my $modcode_from_2 = $1;
  29. undef $string2; #Don't need $string2 any more.
  30. $modcode_from_2 =~ s/[[:cntrl:]]//gm; #Remove control characters
  31.  
  32. my @codes1 = split /\./, $modcode_from_1;
  33. my @codes2 = split /\./, $modcode_from_2;
  34.  
  35. printf "%-35s %s\n", $filename1, $filename2;
  36. my $i = 0;
  37. foreach (@codes1) {
  38. unless ($codes1[$i] eq $codes2[$i]) {
  39. printf "%-35s is not the same as %s\n", $codes1[$i], $codes2[$i];
  40. }
  41. $i++;
  42. }
Running this prints the following output:
text Syntax (Toggle Plain Text)
  1. 1.txt 2.txt
  2. CLKIN1(clk_IBUF_7819), is not the same as CLKIN1(clk_IBUF_2571),
  3. CLKOUT0(clk_out0_OBUF_7848), is not the same as CLKOUT0(clk_out0_OBUF_2333),
  4. LOCKED(i_MMCM_ADV_ML_NEW_I1), is not the same as LOCKED(LOCKED_OBUF_2386),
Reputation Points: 153
Solved Threads: 140
Master Poster
d5e5 is offline Offline
735 posts
since Sep 2009
Sep 5th, 2010
0
Re: text files modules comparision
i was very much thankful to you for your great timely help.

code is working like gem.
Reputation Points: 12
Solved Threads: 0
Light Poster
koduruabhinav is offline Offline
43 posts
since Jan 2010
Sep 5th, 2010
0
Re: text files modules comparision
You are welcome. Please mark the thread solved. It helps keep our forum organised.
Reputation Points: 153
Solved Threads: 140
Master Poster
d5e5 is offline Offline
735 posts
since Sep 2009
Sep 6th, 2010
0
Re: text files modules comparision
Hi,
The code works for i_MMCM_ADV
But not working for X_MMCM_ADV

My requirement is reg expression starting x_MMCM_ADV
and end with semicolan in I_MMCM_ADV module

first file

X_MMCM_ADV #(
.CLOCK_HOLD ( "FALSE" ),
.CLKOUT4_CASCADE ( "FALSE" ),
.BANDWIDTH ( "OPTIMIZED" ),
.CLKFBOUT_USE_FINE_PS ( "FALSE" ),
.CLKOUT0_USE_FINE_PS ( "FALSE" ),
.CLKOUT1_USE_FINE_PS ( "FALSE" ),
.CLKOUT2_USE_FINE_PS ( "FALSE" ),
.CLKOUT3_USE_FINE_PS ( "FALSE" ),
.CLKOUT4_USE_FINE_PS ( "FALSE" ),
.CLKOUT5_USE_FINE_PS ( "FALSE" ),
.CLKOUT6_USE_FINE_PS ( "FALSE" ),
.COMPENSATION ( "ZHOLD" ),
.STARTUP_WAIT ( "FALSE" ),
.CLKFBOUT_MULT_F ( 5.000000 ),
.CLKFBOUT_PHASE ( 0.000000 ),
.CLKOUT0_DIVIDE_F ( 10.000000 ),
.CLKOUT0_DUTY_CYCLE ( 0.500000 ),
.CLKOUT0_PHASE ( 0.000000 ),
.CLKOUT1_DUTY_CYCLE ( 0.500000 ),
.CLKOUT1_PHASE ( 0.000000 ),
.CLKOUT2_DUTY_CYCLE ( 0.500000 ),
.CLKOUT2_PHASE ( 0.000000 ),
.CLKOUT3_DUTY_CYCLE ( 0.500000 ),
.CLKOUT3_PHASE ( 0.000000 ),
.CLKOUT4_DUTY_CYCLE ( 0.500000 ),
.CLKOUT4_PHASE ( 0.000000 ),
.CLKOUT5_DUTY_CYCLE ( 0.500000 ),
.CLKOUT5_PHASE ( 0.000000 ),
.CLKOUT6_DUTY_CYCLE ( 0.500000 ),
.CLKOUT6_PHASE ( 0.000000 ),
.REF_JITTER1 ( 0.010000 ),
.REF_JITTER2 ( 0.010000 ),
.CLKOUT1_DIVIDE ( 20 ),
.CLKOUT2_DIVIDE ( 40 ),
.CLKOUT3_DIVIDE ( 60 ),
.CLKOUT4_DIVIDE ( 80 ),
.CLKOUT5_DIVIDE ( 100 ),
.CLKOUT6_DIVIDE ( 120 ),
.DIVCLK_DIVIDE ( 1 ),
.CLKIN1_PERIOD ( 5 ),
.CLKIN2_PERIOD ( 5 ),
.LOC ( "MMCM_ADV_X0Y0" ),
.VCOCLK_FREQ_MAX ( 1200.000000 ),
.VCOCLK_FREQ_MIN ( 600.000000 ),
.CLKIN_FREQ_MAX ( 700.000000 ),
.CLKIN_FREQ_MIN ( 10.000000 ),
.CLKPFD_FREQ_MAX ( 450.000000 ),
.CLKPFD_FREQ_MIN ( 10.000000 ))
i_MMCM_ADV (
.CLKFBIN(CLKFBIN),
.PSCLK(GND),
.PWRDWN(\i_MMCM_ADV/PWRDWN_INT ),
.DCLK(GND),
.DEN(GND),
.CLKINSEL(\i_MMCM_ADV/CLKINSEL_INT ),
.CLKIN2(GND),
.RST(\i_MMCM_ADV/RST_INT ),
.PSINCDEC(\i_MMCM_ADV/PSINCDEC_INT ),
.DWE(GND),
.PSEN(\i_MMCM_ADV/PSEN_INT ),
.CLKIN1(clk_IBUF_7819),
.CLKOUT3(CLKOUT3),
.CLKOUT3B(\i_MMCM_ADV/CLKOUT3B ),
.CLKFBOUT(CLKFBOUT),
.CLKFBSTOPPED(\i_MMCM_ADV/CLKFBSTOPPED ),
.CLKFBOUTB(\i_MMCM_ADV/CLKFBOUTB ),
.CLKOUT1(CLKOUT1),
.CLKOUT5(CLKOUT5),
.DRDY(\i_MMCM_ADV/DRDY ),
.CLKOUT0(clk_out0_OBUF_7848),
.CLKOUT4(CLKOUT4),
.CLKOUT1B(\i_MMCM_ADV/CLKOUT1B ),
.CLKINSTOPPED(\i_MMCM_ADV/CLKINSTOPPED ),
.CLKOUT0B(\i_MMCM_ADV/CLKOUT0B ),
.CLKOUT2(CLKOUT2),
.CLKOUT2B(\i_MMCM_ADV/CLKOUT2B ),
.PSDONE(\i_MMCM_ADV/PSDONE ),
.CLKOUT6(CLKOUT6),
.LOCKED(i_MMCM_ADV_ML_NEW_I1),
.DI({GND, GND, GND, GND, GND, GND, GND, GND, GND, GND, GND, GND, GND, GND, GND, GND}),
.DADDR({GND, GND, GND, GND, GND, GND, GND}),
.DO({\i_MMCM_ADV/DO15 , \i_MMCM_ADV/DO14 , \i_MMCM_ADV/DO13 , \i_MMCM_ADV/DO12 , \i_MMCM_ADV/DO11 , \i_MMCM_ADV/DO10 , \i_MMCM_ADV/DO9 ,
\i_MMCM_ADV/DO8 , \i_MMCM_ADV/DO7 , \i_MMCM_ADV/DO6 , \i_MMCM_ADV/DO5 , \i_MMCM_ADV/DO4 , \i_MMCM_ADV/DO3 , \i_MMCM_ADV/DO2 , \i_MMCM_ADV/DO1 ,
\i_MMCM_ADV/DO0 })
);



Second file



X_MMCM_ADV #(
.CLOCK_HOLD ( "FALSE" ),
.CLKOUT4_CASCADE ( "FALSE" ),
.BANDWIDTH ( "OPTIMIZED" ),
.CLKFBOUT_USE_FINE_PS ( "FALSE" ),
.CLKOUT0_USE_FINE_PS ( "FALSE" ),
.CLKOUT1_USE_FINE_PS ( "FALSE" ),
.CLKOUT2_USE_FINE_PS ( "FALSE" ),
.CLKOUT3_USE_FINE_PS ( "FALSE" ),
.CLKOUT4_USE_FINE_PS ( "FALSE" ),
.CLKOUT5_USE_FINE_PS ( "FALSE" ),
.CLKOUT6_USE_FINE_PS ( "FALSE" ),
.COMPENSATION ( "EXTERNAL" ),
.STARTUP_WAIT ( "FALSE" ),
.CLKFBOUT_MULT_F ( 5.000000 ),
.CLKFBOUT_PHASE ( 0.000000 ),
.CLKOUT0_DIVIDE_F ( 10.000000 ),
.CLKOUT0_DUTY_CYCLE ( 0.500000 ),
.CLKOUT0_PHASE ( 0.000000 ),
.CLKOUT1_DUTY_CYCLE ( 0.500000 ),
.CLKOUT1_PHASE ( 0.000000 ),
.CLKOUT2_DUTY_CYCLE ( 0.500000 ),
.CLKOUT2_PHASE ( 0.000000 ),
.CLKOUT3_DUTY_CYCLE ( 0.500000 ),
.CLKOUT3_PHASE ( 0.000000 ),
.CLKOUT4_DUTY_CYCLE ( 0.500000 ),
.CLKOUT4_PHASE ( 0.000000 ),
.CLKOUT5_DUTY_CYCLE ( 0.500000 ),
.CLKOUT5_PHASE ( 0.000000 ),
.CLKOUT6_DUTY_CYCLE ( 0.500000 ),
.CLKOUT6_PHASE ( 0.000000 ),
.REF_JITTER1 ( 0.010000 ),
.REF_JITTER2 ( 0.010000 ),
.CLKOUT1_DIVIDE ( 20 ),
.CLKOUT2_DIVIDE ( 40 ),
.CLKOUT3_DIVIDE ( 60 ),
.CLKOUT4_DIVIDE ( 80 ),
.CLKOUT5_DIVIDE ( 100 ),
.CLKOUT6_DIVIDE ( 120 ),
.DIVCLK_DIVIDE ( 1 ),
.CLKIN1_PERIOD ( 5.000000 ),
.CLKIN2_PERIOD ( 5.000000 ),
.LOC ( "MMCM_ADV_X0Y5" ),
.VCOCLK_FREQ_MAX ( 1200.000000 ),
.VCOCLK_FREQ_MIN ( 600.000000 ),
.CLKIN_FREQ_MAX ( 700.000000 ),
.CLKIN_FREQ_MIN ( 10.000000 ),
.CLKPFD_FREQ_MAX ( 450.000000 ),
.CLKPFD_FREQ_MIN ( 10.000000 ))
i_MMCM_ADV (
.CLKFBIN(CLKFBIN),
.PSCLK(GND),
.PWRDWN(\i_MMCM_ADV/PWRDWN_INT ),
.DCLK(GND),
.DEN(GND),
.CLKINSEL(\i_MMCM_ADV/CLKINSEL_INT ),
.CLKIN2(GND),
.RST(\i_MMCM_ADV/RST_INT ),
.PSINCDEC(\i_MMCM_ADV/PSINCDEC_INT ),
.DWE(GND),
.PSEN(\i_MMCM_ADV/PSEN_INT ),
.CLKIN1(clk_IBUF_2571),
.CLKOUT3(CLKOUT3),
.CLKOUT3B(\i_MMCM_ADV/CLKOUT3B ),
.CLKFBOUT(CLKFBOUT),
.CLKFBSTOPPED(\i_MMCM_ADV/CLKFBSTOPPED ),
.CLKFBOUTB(\i_MMCM_ADV/CLKFBOUTB ),
.CLKOUT1(CLKOUT1),
.CLKOUT5(CLKOUT5),
.DRDY(\i_MMCM_ADV/DRDY ),
.CLKOUT0(clk_out0_OBUF_2333),
.CLKOUT4(CLKOUT4),
.CLKOUT1B(\i_MMCM_ADV/CLKOUT1B ),
.CLKINSTOPPED(\i_MMCM_ADV/CLKINSTOPPED ),
.CLKOUT0B(\i_MMCM_ADV/CLKOUT0B ),
.CLKOUT2(CLKOUT2),
.CLKOUT2B(\i_MMCM_ADV/CLKOUT2B ),
.PSDONE(\i_MMCM_ADV/PSDONE ),
.CLKOUT6(CLKOUT6),
.LOCKED(LOCKED_OBUF_2386),
.DI({GND, GND, GND, GND, GND, GND, GND, GND, GND, GND, GND, GND, GND, GND, GND, GND}),
.DADDR({GND, GND, GND, GND, GND, GND, GND}),
.DO({\i_MMCM_ADV/DO15 , \i_MMCM_ADV/DO14 , \i_MMCM_ADV/DO13 , \i_MMCM_ADV/DO12 , \i_MMCM_ADV/DO11 , \i_MMCM_ADV/DO10 , \i_MMCM_ADV/DO9 ,
\i_MMCM_ADV/DO8 , \i_MMCM_ADV/DO7 , \i_MMCM_ADV/DO6 , \i_MMCM_ADV/DO5 , \i_MMCM_ADV/DO4 , \i_MMCM_ADV/DO3 , \i_MMCM_ADV/DO2 , \i_MMCM_ADV/DO1 ,
\i_MMCM_ADV/DO0 })
);
Attached Files
File Type: txt 1.txt (3.0 KB, 16 views)
File Type: txt 2.txt (3.4 KB, 19 views)
Reputation Points: 12
Solved Threads: 0
Light Poster
koduruabhinav is offline Offline
43 posts
since Jan 2010
Sep 6th, 2010
0
Re: text files modules comparision
i have changed the module names and tried by changing the RE but error or warning comes says modules not initialized
Reputation Points: 12
Solved Threads: 0
Light Poster
koduruabhinav is offline Offline
43 posts
since Jan 2010
Sep 6th, 2010
0
Re: text files modules comparision
Finally I was in SUCCESS.
Last edited by koduruabhinav; Sep 6th, 2010 at 3:37 am.
Reputation Points: 12
Solved Threads: 0
Light Poster
koduruabhinav is offline Offline
43 posts
since Jan 2010
Sep 6th, 2010
0
Re: text files modules comparision
Perl Syntax (Toggle Plain Text)
  1.  
  2. use strict;
  3. use warnings;
  4. #use Getopt::Long;
  5. #my $filename1;
  6. #my $filename2;
  7. #my $modul;
  8. #my @args = @ARGV;
  9. #print "Getting the options";
  10. # my $ok = &GetOptions("args" => sub { &PrintArgs(\@args) },
  11. # "h|help|?" => sub { &Help },
  12. 3 "filename1=s" => \$filename1,
  13. # "filename2=s" => \$filename2,
  14. # "modul=s" => \$modul);
  15. # print "\n\n";
  16. # print " --------------------------------File1: $filename1 #File2:$filename2 -------------------------------------\n\n\n\n";
  17.  
  18.  
  19. my $modul='X_MMCM_ADV';
  20. my $filename1 = 'ise_routed.v';
  21. my $filename2 = 'rodin_routed.v';
  22.  
  23.  
  24.  
  25. my $string1 = readfile( $filename1);
  26.  
  27. my $string2 = readfile( $filename2);
  28.  
  29.  
  30. sub readfile {
  31.  
  32. my ($file) = @_;
  33. local $/;
  34. open my $fh,'<',"$file" or die "open of $file failed: $!\n";
  35. <$fh>;
  36. };
  37.  
  38.  
  39.  
  40.  
  41.  
  42. $string1 =~ /$modul #\(([^;]*)\);/s;
  43. my $modcode_from_1 = $1;
  44. #print "$modcode_from_1";
  45. open (MYFILE, '>module1.txt');
  46. print MYFILE "$modcode_from_1\n";
  47. close (MYFILE);
  48. undef $string1;
  49. $modcode_from_1 =~ s/[[:cntrl:]]//gm;
  50.  
  51.  
  52. $string2 =~ /$modul #\(([^;]*)\);/s;
  53. my $modcode_from_2 = $1;
  54. #print "$modcode_from_2";
  55. open (MYFILE1, '>module2.txt');
  56. print MYFILE1 "$modcode_from_2\n";
  57. close (MYFILE1);
  58. undef $string2;
  59. $modcode_from_2 =~ s/[[:cntrl:]]//gm;
  60.  
  61.  
  62.  
  63. my @codes1 = split /\./, $modcode_from_1;
  64.  
  65. my @codes2 = split /\./, $modcode_from_2;
  66.  
  67.  
  68. print "\t\t****************THE DIFFERENCES IN THE FILES ARE AS FOLLOWS****************\n\n\n";
  69.  
  70. printf "\t\t\t%-45s %s\n\n\n", $filename1, $filename2;
  71.  
  72. my $i = 0;
  73. foreach (@codes1) {
  74. unless ($codes1[$i] eq $codes2[$i]) {
  75.  
  76. printf "\t%-45s is not the same as %s\n\n", $codes1[$i], $codes2[$i];
  77.  
  78.  
  79.  
  80. }
  81.  
  82.  
  83.  
  84. $i++;
  85. }



we get module1 and module 2 from the two files

which i have uploaded.

But actually the problem is i was not listing differences correctly

i have uploade the output image also

but actually that number of differences are not there.

only 6 to 8 diifferences are ther so how to handle this problem

i was much concentrated on modules comparision
Attached Thumbnails
Click image for larger version

Name:	output.PNG
Views:	17
Size:	105.4 KB
ID:	17070  
Attached Files
File Type: txt 1.txt (3.0 KB, 16 views)
File Type: txt 2.txt (3.4 KB, 17 views)
Reputation Points: 12
Solved Threads: 0
Light Poster
koduruabhinav is offline Offline
43 posts
since Jan 2010

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Perl Forum Timeline: counting problem
Next Thread in Perl Forum Timeline: modules comparision in parameter wise in text files





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC