need help with recode command for CR/LF

Not sure if this is a Linux issue or specific to SuSE Linux, but, in the infinite wisdom of the developers they decided to do away with the dos2unix and unix2dos commands which were very handy in handling the CR/LF issue between unix and dos/windows files.

More to the point I've created a tr command to strip CR's from dos/windows files in unix. However, the best/only way I can find to get the CR into unix files that I need to send to dos/windows is the recode command. However, every different conversion table that I've used to convert (pc, utf-8/CRLF, etc.) the file to get the CR LF pairs always puts the CR (0d) after the LF (0a) and not before. This poses a problem when I try to send this file in a mail message to Outlook.

The bottom line, the unix2dos command always put the CR (0d) before the LF (0a) whenever I ran it and I never had a problem sending these files to windows/outlook. However, when I do this using the recode command the Outlook mail message comes in with an attachment of .dat and doesn't look right when I open it.

I'm pretty sure this is an issue caused by the fact that the CR is being put AFTER the LF instead of before it on each line in the text file. I can take the same file, run it through the unix2dos command in a unix server I have and send it to my Outlook mail and the text comes in in the body of the email message and looks just fine. However, when I run the same file through recode and send it it comes in as an attachment to the email with a .dat extension.

Does anyone know of a conversion table that I can use in recode which will put the CR before the LF instead of after it?

Or, is there a way to accomplish this same thing using another unix/Linux command such as tr and/or sed?

Text File Data
-------------
This is line 1 of a test file.
This is line 2 of a test file.
This is line 3 of a test file.
This is line 4 of a test file.
This is line 5 of a test file.
This is line 6 of a test file.
This is line 7 of a test file.
This is line 8 of a test file.
This is line 9 of a test file.

Hex Dump of the above file (note the 0a LF's at the end of each line)
------------------------------------------------------------------
0000000 6854 7369 6920 2073 696c 656e 3120 6f20
0000020 2066 2061 6574 7473 6620 6c69 2e65 540a
0000040 6968 2073 7369 6c20 6e69 2065 2032 666f
0000060 6120 7420 7365 2074 6966 656c 0a2e 6854
0000100 7369 6920 2073 696c 656e 3320 6f20 2066
0000120 2061 6574 7473 6620 6c69 2e65 540a 6968
0000140 2073 7369 6c20 6e69 2065 2034 666f 6120
0000160 7420 7365 2074 6966 656c 0a2e 6854 7369
0000200 6920 2073 696c 656e 3520 6f20 2066 2061
0000220 6574 7473 6620 6c69 2e65 540a 6968 2073
0000240 7369 6c20 6e69 2065 2036 666f 6120 7420
0000260 7365 2074 6966 656c 0a2e 6854 7369 6920
0000300 2073 696c 656e 3720 6f20 2066 2061 6574
0000320 7473 6620 6c69 2e65 540a 6968 2073 7369
0000340 6c20 6e69 2065 2038 666f 6120 7420 7365
0000360 2074 6966 656c 0a2e 6854 7369 6920 2073
0000400 696c 656e 3920 6f20 2066 2061 6574 7473
0000420 6620 6c69 2e65 000a

I then run something similar to recode ..pc < recode.txt > recodecrlf.txt and it runs fine.

Hexdump of recodecrlf.txt
--------------------------
0000000 6854 7369 6920 2073 696c 656e 3120 6f20
0000020 2066 2061 6574 7473 6620 6c69 2e65 0a0d
0000040 6854 7369 6920 2073 696c 656e 3220 6f20
0000060 2066 2061 6574 7473 6620 6c69 2e65 0a0d
0000100 6854 7369 6920 2073 696c 656e 3320 6f20
0000120 2066 2061 6574 7473 6620 6c69 2e65 0a0d
0000140 6854 7369 6920 2073 696c 656e 3420 6f20
0000160 2066 2061 6574 7473 6620 6c69 2e65 0a0d
0000200 6854 7369 6920 2073 696c 656e 3520 6f20
0000220 2066 2061 6574 7473 6620 6c69 2e65 0a0d
0000240 6854 7369 6920 2073 696c 656e 3620 6f20
0000260 2066 2061 6574 7473 6620 6c69 2e65 0a0d
0000300 6854 7369 6920 2073 696c 656e 3720 6f20
0000320 2066 2061 6574 7473 6620 6c69 2e65 0a0d
0000340 6854 7369 6920 2073 696c 656e 3820 6f20
0000360 2066 2061 6574 7473 6620 6c69 2e65 0a0d
0000400 6854 7369 6920 2073 696c 656e 3920 6f20
0000420 2066 2061 6574 7473 6620 6c69 2e65 0a0d

Note that the Od follows the 0a instead of being before it

Hex dump of the same file run through a unix2dos command on a unix server
------------------------------------------------------------------------
0000000 5468 6973 2069 7320 6c69 6e65 2031 206f
0000020 6620 6120 7465 7374 2066 696c 652e 0d0a
0000040 5468 6973 2069 7320 6c69 6e65 2032 206f
0000060 6620 6120 7465 7374 2066 696c 652e 0d0a
0000100 5468 6973 2069 7320 6c69 6e65 2033 206f
0000120 6620 6120 7465 7374 2066 696c 652e 0d0a
0000140 5468 6973 2069 7320 6c69 6e65 2034 206f
0000160 6620 6120 7465 7374 2066 696c 652e 0d0a
0000200 5468 6973 2069 7320 6c69 6e65 2035 206f
0000220 6620 6120 7465 7374 2066 696c 652e 0d0a
0000240 5468 6973 2069 7320 6c69 6e65 2036 206f
0000260 6620 6120 7465 7374 2066 696c 652e 0d0a
0000300 5468 6973 2069 7320 6c69 6e65 2037 206f
0000320 6620 6120 7465 7374 2066 696c 652e 0d0a
0000340 5468 6973 2069 7320 6c69 6e65 2038 206f
0000360 6620 6120 7465 7374 2066 696c 652e 0d0a
0000400 5468 6973 2069 7320 6c69 6e65 2039 206f
0000420 6620 6120 7465 7374 2066 696c 652e 0d0a

To convert the files you can use these commands:

Dos to Unix:

tr -d '\r' < dosfile > unixfile

Unix to Dos:

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