Mail attachment dispaying in different format.

Hi friends,

I have file1.txt where i am sending this file as attatment in mail using below code

 
uuencode file1.txt file1.txt | mail -s  'TestFile' test@test.com

but the format of the file is changing when i open in attachement.

file1.txt in unix

 
1|hyd|nag
2|jun|kin

file1.txt in notepad

 
1|hyd|nag 2|jun|kin

Please help.

I guess Notepad is on Windows? Then you need to add a <CR> (0x0D) char before the newline char at the end of the line. Don't know if uuencode can do this for you.

1 Like

@Rudic, Thanaks for the reply. Yes your correct, notepad in windows. We are Using AIX OS, Is there any posibility other than uuencode so that we can use <CR> . and could please explain the <CR> concept .

Have you tried opening in WordPad?
Also, there are two routines that many use when moving files:
dos2unix and unix2dos

Text is treated differently in UNIX and in Windows. UNIX only requires a newline char (hexadecimal 0x0A) while Windows needs two chars: carriage return (<CR>, 0x0D) plus newline to end a line. As joeyg points out, there might be other editors (e.g. EDITPAD) that can handle UNIX text. A powerful alternative to unix2dos is recode (e.g. recode lat1..ibmpc file1.txt)