Advertisement
ZaynerTech

Twitter Follow filter

Feb 8th, 2013
446
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.40 KB | None | 0 0
  1. #!/usr/bin/perl
  2. #
  3. # Perl script for filtering twitter follower data
  4. #
  5.  
  6. open(FILE, $ARGV[0]);
  7. open(FILER,">","data.new");
  8. $high = 0;
  9.  
  10. @file = <FILE>;
  11.  
  12. foreach $line (@file)
  13. {
  14.  
  15.    @stuff = split(/\s+/,$line);
  16.    chomp($stuff[1]);
  17.    $stuff[1] =~ s/,//g;
  18.    if($stuff[1] >= $high){ $high = $stuff[1]; }
  19.    print FILER "$stuff[0] $high\n";
  20.    undef(@stuff);
  21.  
  22.  
  23. }
  24. close(FILER);
  25. close(FILE);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement