perl -ne 'open(FILE, ">>".$1) if /^(.*?)\s(.*)$/; print FILE $2."\n"; close FILE' data_file