#!/usr/bin/perl
#
# Programmer:    Craig Stuart Sapp <craig@ccrma.stanford.edu>
# Creation Date: Mon Dec 18 05:04:22 PST 2006
# Last Modified: Mon Dec 18 05:04:22 PST 2006
# Filename:      /project/mazurka/website/info/revcond/pid9056-15/temp/getRealBeats
# Syntax:        perl 5
#
# Description:
#

use strict;

my $realbeats = $ARGV[0];
my $allbeats  = $ARGV[1];

my @real;


open (FILE, $realbeats) or die "Cannot open $realbeats";

my $line;
while ($line = <FILE>) {
   chomp $line;
   $real[$line] = 1;
}
close FILE;

my $testbeat;
my $time;

open (FILE, $allbeats) or die "Cannot open $allbeats";

while ($line = <FILE>) {
   chomp $line;
   if ($line =~ /^([\d\.]+)\s+a?([\d\.]+)$/) {
      $testbeat = $2;
      $time = $1;
      if ($real[$testbeat] > 0) {
         print "{$testbeat, $time},\n";
      }
   }
}

close FILE;



