print "\"$field1\"\t\"$field2\"\n"; output... I took out "" in data input because it was too confusing a printout. "-0.500" " 4.502e-6" "-0.499" " 4.474e-6" "-0.498" " 4.458e-6" "-0.497" " 4.445e-6" "-0.496" " 4.433e-6" "-0.495" " 4.421e-6" #### my @fields = split /[\s,]+/; #### while(){ chomp(); #optional #s/[^\w\.\,\-]//g; tr /0-9.-e ,//dc; #another possibility.. my ($field1, $field2) = (split /[\s,]+/)[0,1]; print "\"$field1\"\t\"$field2\"\n"; } __DATA__ "-0.500, 4.502e-6" "-0.499, 4.474e-6" "-0.498, 4.458e-6" "-0.497, 4.445e-6" "-0.496, 4.433e-6" "-0.495, 4.421e-6"