# HG changeset patch # User mir-bioinf # Date 1429887397 14400 # Node ID 358c9e0b915449a4eec37e7567aeb14dbeca3e57 Initial upload diff -r 000000000000 -r 358c9e0b9154 ColRangeGenerator/ColRangeGenerator.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ColRangeGenerator/ColRangeGenerator.pl Fri Apr 24 10:56:37 2015 -0400 @@ -0,0 +1,31 @@ +#! /usr/bin/perl -w + +use strict; +use warnings; +use Text::ParseWords; + +##Args are col range and output file name ONLY. no spaces!! + +die "Please check arguments, probably spaces in column range!\n" unless @ARGV == 2; + +my $colrange = $ARGV[0]; +my $outputfile = $ARGV[1]; + +my @cols = split(/-/,$colrange); +die "Improper range format: probably missing - (hyphen) or it's at the end.\n" unless exists($cols[1]); + +my @start = split('C',uc($cols[0]),2); +my @stop = split('C',uc($cols[1]),2); +die "Improper column format: missing preceding C for col number.\n" unless (exists($start[1]) && exists($stop[1])); + +my $begin = $start[1]; +my $end = $stop[1]; + +my $fhOut; +open ($fhOut, "> $outputfile"); +for (my $i=$begin; $i<$end; $i++) { + print $fhOut "c$i,"; +} +print $fhOut "c$end\n"; + +close ($fhOut) or die "Cannot close output file\n"; diff -r 000000000000 -r 358c9e0b9154 ColRangeGenerator/ColRangeGenerator.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ColRangeGenerator/ColRangeGenerator.xml Fri Apr 24 10:56:37 2015 -0400 @@ -0,0 +1,23 @@ + + for cut or remove large ranges of columns + ColRangeGenerator.pl $cols $coldelim + + + + + + + + + + + + + + + Use this tool to generate a string that can be copied to the buffer then pasted into the Cut Column tool to save time (rather than needing to individually type out c1,c2,c3..... etc.). + + + + diff -r 000000000000 -r 358c9e0b9154 ColRangeGenerator/test-data/ColRangeGenerator_out.csv --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/ColRangeGenerator/test-data/ColRangeGenerator_out.csv Fri Apr 24 10:56:37 2015 -0400 @@ -0,0 +1,1 @@ +c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13,c14,c15,c16,c17