01 June 2006

Intersection of Contents in Two Files

#!/usr/bin/perl
#/*Author : ~rAGU (ragu dot ks at gmail dot com) */
#/*Descripation: A script to find the intersection set of the lines in two text files */
#/* when one of the file is a subset of the other */
#/* finsec.pl */

open (SET, @ARGV[0]);
$isInSubset = 0;
$count = 0;

while ($lineInSet = ) {
chop($lineInSet);
#$lineInSet =~ s/^\s*(.*?)\s*$/$1/;
$count++;
$counts = 0;
open (SUBSET, @ARGV[1]);

while ($lineInSubset = ) {
$counts++;
chop($lineInSubset);
#$lineInSubset =~ s/^\s*(.*?)\s*$/$1/;

if ($lineInSet eq $lineInSubset) {
$isInSubset = 1;
}

} #End subset loop

close (SUBSET);
if ($isInSubset == 0){
#chop($lineInSet);
print "$lineInSet";
}
$isInSubset =0;

} #End of set loop

close (SET);

#/* End of the program */

5 comments:

  1. Anonymous8:44 am

    Great site lots of usefull infomation here.
    »

    ReplyDelete
  2. Anonymous12:06 pm

    I really enjoyed looking at your site, I found it very helpful indeed, keep up the good work.
    »

    ReplyDelete
  3. Anonymous4:02 pm

    Hey what a great site keep up the work its excellent.
    »

    ReplyDelete
  4. You made such an interesting piece to read, giving every subject enlightenment for us to gain knowledge. Thanks for sharing the such information with us to read this... pgslot

    ReplyDelete
  5. Slot machines have been around for a long time now, you can stroll into any gambling club far and wide and you will discover a slot machined calling your name. In this day and age of innovation you would now be able to play online slot games. How To Win playing slots

    ReplyDelete

Please leave a note about what you think about this write up. Thanks.

ಯಕ್ಷಮಿತ್ರದಿಂದ ಹೊಸ್ತೋಟ ಭಾಗವತರ ಯಕ್ಷಗಾನ ಲಕ್ಷಣ ಗ್ರಂಥ ಪ್ರಕಟಣೆ

                      ಪುಸ್ತಕಕ್ಕಾಗಿ ಸಂಪರ್ಕಿಸಿ ಅಮೇರಿಕಾಸ್: +16473283934                        ಭಾರತ — ರವೀಂದ್ರ ಮುದ್ರಣಾಲಯ ಸಾಗರ, ಮೋ: +9194495872...