If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > Bad data after sending mail

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-11-04, 10:23
markjason markjason is offline
Registered User
 
Join Date: Jun 2004
Posts: 46
Bad data after sending mail

Hi ,

I am not getting the right file when i tried to send a file using mail commands

Actual file I am trying to send is
SourceRecordCount|TargetRecordCount|SourceDebitsTo tal|TargetDebitsTotal|SourceCreditsTotal|TargetCre ditsTotal
250778|262498|89526460118.70|97344532806.30|895264 60118.70|97344532806.30


but when i look at the sent mail output file is like below with
SourceRecordCount|TargetRecordCount|SourceDebitsTo tal|TargetDebitsTotal|SourceCreditsTotal|TargetCre ditsTotal
250778|262498|89526460118.70|97344532806.30|895264 60118.70|97344532806.3
250778|262498|0

But my question is why I am getting extra lines in the bold in the mail....
I have checked for any unprintable characters or special characters in the file but i don't see any... this is only happening with the first line...

Can anyone help me figureout what I am doing wrong...

Thanks
Mark.
Reply With Quote
  #2 (permalink)  
Old 11-11-04, 19:12
LKBrwn_DBA LKBrwn_DBA is offline
Registered User
 
Join Date: Jun 2003
Location: West Palm Beach, FL
Posts: 2,456
Cool

What commands are you using?
Have you tried sending data as attachment?
Code:
uuencode MyData File1.txt|mailx -s"Data file attached" foo@bar.com
__________________
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
Reply With Quote
  #3 (permalink)  
Old 11-11-04, 20:56
markjason markjason is offline
Registered User
 
Join Date: Jun 2004
Posts: 46
I am using mailx command to send the mail

mailx -s "Hi" mark@ford.com < file.txt

Thanks
Mark.
Reply With Quote
  #4 (permalink)  
Old 11-12-04, 08:18
LKBrwn_DBA LKBrwn_DBA is offline
Registered User
 
Join Date: Jun 2003
Location: West Palm Beach, FL
Posts: 2,456
Thumbs down

Somehow mailx is interpreting the pipe (|) character and 'wrapping' the line.
You can either use another character (like ~ or ^), or send the file as attachment.
__________________
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
Reply With Quote
  #5 (permalink)  
Old 11-12-04, 08:23
LKBrwn_DBA LKBrwn_DBA is offline
Registered User
 
Join Date: Jun 2003
Location: West Palm Beach, FL
Posts: 2,456
Thumbs down

Somehow mailx is interpreting the pipe (|) character and 'wrapping' the line.
You can either use another character (like ~ or ^), or send the file as attachment.
__________________
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
Reply With Quote
  #6 (permalink)  
Old 11-12-04, 08:48
LKBrwn_DBA LKBrwn_DBA is offline
Registered User
 
Join Date: Jun 2003
Location: West Palm Beach, FL
Posts: 2,456
Wink

I found out your problem, you have space characters here: |SourceDebitsTo tal| and here: |895264 60118.70|
Disregard the previous posting about the 'pipe' character.
__________________
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb

Last edited by LKBrwn_DBA; 11-12-04 at 08:54.
Reply With Quote
  #7 (permalink)  
Old 11-12-04, 10:14
markjason markjason is offline
Registered User
 
Join Date: Jun 2004
Posts: 46
Thanks for your reply,

But as you said, space is not causing the issue, when i removed the space and tried the same command, somehow i am getting the same wrong output as i was getting previously,.... i couldn't figurout what else is causing the problem....

when i copy the same line in the file as 10 additional lines, i am getting error for first line but remaining 10 lines data looks good..

Thanks
Mark.
Reply With Quote
  #8 (permalink)  
Old 11-12-04, 10:18
markjason markjason is offline
Registered User
 
Join Date: Jun 2004
Posts: 46
Thanks, Brown...

You are right when i changed delimeter to ','... it is working ...Thanks

But still Can you explain why'|' is interpreted as wrapping the line..

Thanks
Mark.
Reply With Quote
  #9 (permalink)  
Old 11-12-04, 11:23
LKBrwn_DBA LKBrwn_DBA is offline
Registered User
 
Join Date: Jun 2003
Location: West Palm Beach, FL
Posts: 2,456
Quote:
Originally Posted by markjason
You are right when i changed delimeter to ','... it is working ...Thanks
But still Can you explain why'|' is interpreted as wrapping the line..
Cannot explain, first time I see this behavior. Seems to be it somehow recognizes the 'pipe' and if the line is more than a certain amount of characters, it splits the line and generates some 'key' value for the rest of the slices.

__________________
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On