Text format problem with xmail


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Text format problem with xmail
# 1  
Old 03-23-2011
Text format problem with xmail

Hi,

I have a very weird problem when I try to send a text file to outlook using the xmail command.
Code:
[root@bgsvm0202 tmp]# cat -e dec1.tmp
SPEEDY 23-MAR-2011 01:28 ok$
99svpp pas d'information$
98pdrt pas d'information$
57METZ 22-MAR-2011 23:50 ok$

[root@bgsvm0202 tmp]# cat -e dec2.tmp
SPEEDY 23-MAR-2011 01:14, SaveSYST ==> DerniM-hre : 18-MAR-2011 11:10:08.16$
99svpp pas d'information$
98pdrt pas d'information$
57METZ 22-MAR-2011 23:44, SaveSYST ==> DerniM-hre : 18-MAR-2011 11:17:51.90$

I try to send the file by email with those commands
Code:
mailx -s "dec1" " myadress@xxx.com" < dec1.tmp
mailx -s "dec2" " myadress@xxx.com" < dec2.tmp


In outlook the dec1 is perfectly correct.
Code:
SPEEDY 23-MAR-2011 01:28 ok
99svpp pas d'information
98pdrt pas d'information
57METZ 22-MAR-2011 23:50 ok


dec2 is like that :
Code:
SPEEDY 23-MAR-2011 01:14, SaveSYST ==> Dernière : 18-MAR-2011 11:10:08.16 99svpp pas d'information 98pdrt pas d'information 57METZ 22-MAR-2011 23:44, SaveSYST ==> Dernière : 18-MAR-2011 11:17:51.90

Not easy to read... Every lines are on the same line...
The both files look the sames but something is wrong with dec2...Smilie

Do you have any idea to solve this problem?

Thanks for your help!!

Last edited by Franklin52; 03-23-2011 at 06:23 AM.. Reason: Please use code tags
# 2  
Old 03-23-2011
I guess there are some trailing \n in dec2 whereas in dec1 you have ^M which are in fact \r\n sequence (see man ascii) at the end of the lines.

try this (if unix2dos command is available on your plateform)
Code:
unix2dos dec2.tmp dec2.tmp

Code:
mailx -s "dec2" " myadress@xxx.com" < dec2.tmp

if unix2dos not available you can try :

Code:
printf ",s/.*/&\r/\nw\nq\n" | ed -s dec2.tmp

this will add the missing \r so your end of line will have the "windows style" sequence \r\n instead of the unix single \n.
So outlook may then be able parse this sequence as "newline" instead of the \n which outlook may not be able to understand as being a newline and put everything inline.
then try
Code:
mailx -s "dec2" " myadress@xxx.com" < dec2.tmp

and see if it is displayed as expected

Last edited by ctsgnb; 03-23-2011 at 06:53 AM..
# 3  
Old 03-23-2011
Thanks ctsgnb but both solution didn't work.
I still have the same problem.
Nothing is logical in the problem

An other solution?
# 4  
Old 03-23-2011
what output gives the following commands:

Code:
od -bc dec1.tmp

Code:
od -bc dec2.tmp

???
# 5  
Old 03-23-2011
This symptom can be caused by a Microsoft Outlook setting:
See: Outlook/Tools/Options/Preferences/E-mail Options/
The box "Remove extra line breaks in plain text messages" should be unchecked.
The default for this value changed in Outlook 2003.
# 6  
Old 03-23-2011
I think that I found the solution.
When I delete everything after "SaveSYST", the text format is good.

So I'm looking for the bad characters which is guilty.
I'll tell you which one it is.

Thanks again
# 7  
Old 03-23-2011
To make the file format visible, try this enquiry with "sed":

Code:
sed -n l dec1.tmp
sed -n l dec2.tmp

Have you checked your Outlook settings?
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need script for transferring bulk files from one format to text format

"Help Me" Need script for transferring bulk files from one format to text format in a unix server. Please suggest (2 Replies)
Discussion started by: Kranthi Kumar
2 Replies

2. Shell Programming and Scripting

Format problem while converting text file to csv

Hi , I need a help in following scenario.I tried searching in google but couldn't able to find the exact answer. Sorry if i am re-posting already answered query. While i am trying to convert into log file into csv i couldn't able to get the format which i am looking for. I converted file... (4 Replies)
Discussion started by: varmas424
4 Replies

3. Shell Programming and Scripting

Text Format

I'd like to format a text in unix before mailing it to users. I want to change color and font of my plain text in unix. Thanks.. (1 Reply)
Discussion started by: Sara_84
1 Replies

4. Shell Programming and Scripting

text format

Hi all I need you help to create script get the below output Thanks in advance. Ashan name.txt Wymouth_MRI_Lun79 PACS DR TEMP R drive stat.txt NO Normal Normal Out need Wymouth_MRI_Lun79 NO Normal PACS DR TEMP R drive Normal (1 Reply)
Discussion started by: ashanabey
1 Replies

5. Shell Programming and Scripting

Format problem of text file

Folks pardon me for trivial question. After searching the entire forum i decided to post this question. I have a file with some numbers with commas like this 123,456,789 If i open this textfile with either notepad or wordpad they ae looking absolutely fine. When I open this with excel file... (13 Replies)
Discussion started by: repinementer
13 Replies

6. UNIX for Dummies Questions & Answers

Mail/Xmail doesn't work on Solaris 10

Hi again everyone. I have recently installed Solaris 10 on a server. Everything seems to work fine (users can be added and can log in, internet connectivity works, etc). However I'm struggling to get mail or mailx to work. Say there are two users on my server, Bob and Mary. Server hostname... (3 Replies)
Discussion started by: EugeneG
3 Replies

7. Shell Programming and Scripting

shell scripts that uses mail/xmail

Hello, i'm wondering is it possible to include the 'notify me' tag which s used with outlook or some web-based email clients that notify you as soon as that user read the email with mail/xmail/sendmail etc. i'm having scripts that sends a daily email to my sysadmins and i wish to know when... (1 Reply)
Discussion started by: Bashar
1 Replies
Login or Register to Ask a Question