diff galaxy-tools/tools/rdock/bin/sdfield @ 2:0faa03a92843 draft default tip

Uploaded
author dzesikah
date Fri, 26 Aug 2016 10:19:49 -0400
parents ad4bc82457e5
children
line wrap: on
line diff
--- a/galaxy-tools/tools/rdock/bin/sdfield	Fri Aug 26 09:55:15 2016 -0400
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,31 +0,0 @@
-#!/usr/bin/perl 
-# add extra fields to SD records
-use lib "$ENV{'RBT_ROOT'}/lib";
-use SDRecord;
-
-printHelpAndExit() if (scalar(@ARGV) == 0);
-#Parse command line arguments
-my @files;
-my $arg = shift @ARGV;
-printHelpAndExit() if ($arg eq '-h');
-#read records
-my $sdRec = new SDRecord;
-my $nRec=0;
-# if not -h, then must be the FieldName
-my $FieldName = $arg;
-my $FieldVal  = shift @ARGV; # and this must be the filed value
-# rest are the filenames
-while ($sdRec->readRec('DATA'=>1,'LINES'=>1)) {
-	$sdRec->addData('_REC' => ++$nRec);#add record# as temp data field
-	$sdRec->addData('_FILE' => $ARGV);#add filename as temp data field
-	$sdRec->addDataAndLines($FieldName => $FieldVal);
-	$sdRec->writeRec();#write record
-}
-
-sub printHelpAndExit {
-	print "\nAdding fields to SD files\n";
-	print "Usage:\n";
-	print "\tsdfield <Fieldname> <value> <infile[s]>\n";
-	print "\t-h\tthis help\n";
-	print "\t\n";
-}