The script now creates properly formatted dx1 output. All that is left is to have the script write to an output file