#!usr/bin/perl -w use strict; # open the file that has to be read my $input = "Users/Dektop/file123.txt"; die "Cannot open $input\n" unless (open(IN, $input)); #open a new file which has to be made open (my $out, ">outfile123.txt"); #In the while loop, put the columns that have to be printed in the new file. while(){ my @fields = split /\t/,$_; my $ID = $fields[0]; my $WEIGHTED_SUM = $fields[9]; #print the columns { print $out "$ID\ $WEIGHTED_SUM \n"; } } #close the filehandles close($input); close($out);