#!/usr/bin/perl -w
use warnings;
$out1 = $ARGV[0];
$in1 = $ARGV[1];
$fieldname = $ARGV[2];
$idfiles = $ARGV[3];
open(FILE, $idfiles) or die "Can't read file 'filename' [$!]\n";  
@document = <FILE>; 
close (FILE);
$strw = join(",",@document);
$strw =~ tr/\r\n//d;
$fieldValues = join(",",$fieldname,$strw);
system("./mayachemtools/bin/ExtractFromSDFiles.pl -m datafieldbylist -d $fieldValues -r $out1 -o $in1");
