How to avoid Newline character in generated text file?

Hi All,
Just need small help in resolving the special new line character in generated output file.

In one of my shell script I am using following lines to get the spool file (i.e. sfile.txt) and
AAA_XXXX_p111_n222.txt
AAA_YYYY_p111_n222.txt

Here assuming
v_pnum="p111"
v_nid="n222"

 
nawk -F"|" -v v1="${v_pnum}" -v v2="${v_nid}" -v v3="${v_opath}" '{
fn=v3 "/AAA_" (length($1)==2?"XXXX":"YYYY") "_" v1 "_" v2 ".txt"
print > fn
}' ${v_opath}/sfile.txt
 
if [ $? -eq 0 ]
then
sed 's/[ ]*$//' ${v_opath}/AAA_YYYY_${v_pnum}_${v_nid}.txt > ${v_opath}/temp.txt
mv ${v_opath}/temp.txt ${v_opath}/AAA_YYYY_${v_pnum}_${v_nkid}.txt
....
....
....
fi

With this I am getting 2 different files, but when I transfer this file to windows environment and open it in Notepad, I am getting a special new line character (similarly if I place this file in mountpoint folder i.e. having access in UNIX as well as Windows environment, same is the case)

Does anyone have idea like how to avoid this special new line character, or is there a better way of doing the above process.

Example of one of my output files, should look something like this as shown below (if I say Wordwrap no in notepad I get output in well formated)

 
AA|222222222|111|222|03/21|2|cccccccccccccccccccccccccccccccccccccccccccccccccc|dddddddd          |eeeeeeeeeee                        |6666666|uuuuuuuuuu   |          |  |2011/03/21| | | |3|6666666|erertertertert|011|222|  | |          |                 |   |   |  | |          |                 |   |   |  | |          |                 |   |   |  |
AA|222222222|111|222|03/21|2|cccccccccccccccccccccccccccccccccccccccccccccccccc|dddddddd          |eeeeeeeeeee                        |6666666|uuuuuuuuuu   |          |  |2011/03/21| | | |3|6666666|erertertertert|011|222|  | |          |                 |   |   |  | |          |                 |   |   |  | |          |                 |   |   |  |
AA|222222222|111|222|03/21|2|cccccccccccccccccccccccccccccccccccccccccccccccccc|dddddddd          |eeeeeeeeeee                        |6666666|uuuuuuuuuu   |          |  |2011/03/21| | | |3|6666666|erertertertert|011|222|  | |          |                 |   |   |  | |          |                 |   |   |  | |          |                 |   |   |  |
AA|222222222|111|222|03/21|2|cccccccccccccccccccccccccccccccccccccccccccccccccc|dddddddd          |eeeeeeeeeee                        |6666666|uuuuuuuuuu   |          |  |2011/03/21| | | |3|6666666|erertertertert|011|222|  | |          |                 |   |   |  | |          |                 |   |   |  | |          |                 |   |   |  |
AA|222222222|111|222|03/21|2|cccccccccccccccccccccccccccccccccccccccccccccccccc|dddddddd          |eeeeeeeeeee                        |6666666|uuuuuuuuuu   |          |  |2011/03/21| | | |3|6666666|erertertertert|011|222|  | |          |                 |   |   |  | |          |                 |   |   |  | |          |                 |   |   |  |

But it is coming with special characters i.e. box like character at the end of each individual line, and the next logical line starting from the end of first line.

Regards
jc

On the unix side, use the unix2dos (maybe called ux2dos) command on the file. Yur man page has an example of how to use it.

Those odd characters are Ascii 10 - unix newline. Windows uses CR/LF for carriage control