#!/usr/local/bin/perl
if($#ARGV != 1) { die "$0: 2 args expected"; }
($log,$talk) = @ARGV;
$url = "pnm://clyde.npac.syr.edu/users/gcf";
if(!(-f $log)) { die "$0: file $log not found"; }
@lv = split(/\n/,`cat $log`);
foreach $l (@lv) {
($foilset,$foil_id,$timestamp) = split(/\s+/,$l);
$pfx = $foil_id < 10 ? "00" : ($foild_id < 100 ? "0" : "");
$foil_id = "$pfx$foil_id";
$ram_url = "$url/$foilset/audio/$talk.ra\$$timestamp";
print "$ram_url\n";
open(FILE, ">$foil_id.ram") || die "$0: cannot open file $foil_id.ram";
print FILE "$ram_url\n"; 
close FILE;
}
