# pcut 1.01 by Boris New (http://www.borisnew.org)
# The fields must be separated by tabs
# perl pcut -f 5,1-3,8

#$,="\t";
use Getopt::Long;
GetOptions("f=s"=>\$f);
@virg=split(",",$f);
for $i (0..@virg-1){$virg[$i]--;}
	for $i (0..@virg-1){
		if ($virg[$i]!~/-/){push(@col,$virg[$i]);}
		else {
			@tiret=split("-",$virg[$i]);
			for $j ($tiret[0]..$tiret[1]){push(@col,$j);}
		}
	}
while (<>){
	chomp;
	@F=split("\t",$_);
	for $k (0..@col-1){
		if ($k==@col-1){$a="\n";}
		else {$a="\t";}
		print $F[$col[$k]],$a;
	}
}
