Using unix2dos command in the below script

Hi,
Please help me in implemeting unix2dos command so that report output which comes as the attachment through mail is in the proper format

Am using uuencode fro attaching one report which is nothing but sql query output.

But when i receive the report through attachement and when it is opened the report is not displayed in proper format. Means if the query has 100 rows the mail attachment report displays the report in 2 rows itself.Please try to give the solution.

The script as mentioned below

par_file="/dlxfiles/BWParam/OPTIM/NPI.param"
conn_input_file="/dlxfiles/BWParam/OPTIM/all_cons.txt"

yyyymmdd=`date +%Y%m%d`

#SQL_OP="/dlxfiles/TgtFiles/OPTIM/audit_report_ci.txt"
CNT_FILE="/dlxfiles/TgtFiles/OPTIM/audit_report_ci_counts_$yyyymmdd.txt"

rm /dlxfiles/TgtFiles/OPTIM/audit_report_ci.doc
touch /dlxfiles/TgtFiles/OPTIM/audit_report_ci.doc

rm $CNT_FILE
touch $CNT_FILE
#chmod 777 $SQL_OP


for conn_name in `cat $conn_input_file`
do

echo "[C000134.WF:wflw_s_m_Load_NPI_AUDIT.ST:s_m_Load_NPI_AUDIT]" > $par_file
echo "\$DBConnection_Source"=$conn_name>> $par_file
DB_NM=`echo $conn_name | cut -d "_" -f2`

echo "\$\$DBNAME=$DB_NM">>$par_file
echo "\$DBConnection_Target=ADDRLBL_CID1_ETLUSER">> $par_file
echo "\$PMBadFile=/dlxfiles/BadFiles/OPTIM/s_m_Load_NPI_AUDIT.bad">>$par_file
echo "\$PMSessionLogFile=/dlxfiles/SessLogs/OPTIM/s_m_Load_NPI_AUDIT.log">>$par_file
echo "\$PMWorkflowLogDir=/dlxfiles/WorkflowLogs/OPTIM/wflw_s_s_m_Load_NPI_AUDIT.log">>$par_file

Sq_op_file="/dlxfiles/TgtFiles/OPTIM/audit_report_ci_"${DB_NM}"_$yyyymmdd.txt"
echo "#!/usr/bin/sh" >  /dlxfiles/TgtFiles/OPTIM/sql_op.sh
echo "SQL_OP="${Sq_op_file} >> /dlxfiles/TgtFiles/OPTIM/sql_op.sh
echo "export $SQL_OP;" >>  /dlxfiles/TgtFiles/OPTIM/sql_op.sh

. /dlxfiles/Scripts/SHARED/run_infa_workflow.sh C000134 wflw_s_m_Load_NPI_AUDIT

cnt=`cat $Sq_op_file | grep ${DB_NM} |  wc -l`
echo "Total matches found for ${DB_NM}: "$cnt >>$CNT_FILE

uuencode $Sq_op_file $Sq_op_file >> /dlxfiles/TgtFiles/OPTIM/audit_report_ci.doc

done

mailx -s 'Matches' xxx@x.com<  /dlxfiles/TgtFiles/OPTIM/audit_report_ci.doc
 

To convert a unix file to a file in dos format you can do something like:

awk '{printf "%s\r\n", $0}' unixfile > dosfile

unix2dos is the exist command.