Page 1 of 1

E-mail Notification (Attaching a .txt/html file)

Posted: Tue Mar 13, 2012 9:02 am
by DSFreddie
Hi All,

I am trying to attach a .txt & .html (in 2 different e-mail notification activity). The files look in good format (like below) when i ftp'd & opened with notepad.

Process Date : 20120308
Total Adds : 0
Total Changes : 0
Total Deletes : 0
Total Suspects : 6880

But when the email notification attach this file, it is converted to a single line as below, (this report is generated through LINUX scripting)
Process Date : 20120308 Total Adds : 0 Total Changes : 0 Total Deletes : 0 Total Suspects : 6880

Any thoughts will be helpful.

Thanks in advance
Freddie

Posted: Tue Mar 13, 2012 9:30 am
by chulett
Create the file with DOS line terminators.

Posted: Tue Mar 13, 2012 5:37 pm
by DSFreddie
Hi Chulett,

Thanks for your reply.

I googled for more info on DOS line terminators, but couldnt find any info on the same. Can you pls shed some light on this.

Thanks
Freddie

Posted: Tue Mar 13, 2012 5:48 pm
by Kryt0n
When you are FTP'ing, you are likely transferring in ASCII mode which converts the UNIX newline to the Windows newline which is why that looks fine.

Craig's suggestion is to generate the file with a CRLF rather than just a LF. In DataStage terms this is a case of using the end of record terminator string set to DOS terminator string in your target sequential stage.

Posted: Wed Mar 14, 2012 6:13 am
by DSFreddie
Thanks for your reply Kryt0n.

Pls note that I am building this report through a LINUX Shell Script. ( & not through Filestage in DS). Wondering whether we can add DOS line terminator in Script level too.

Thanks
Freddie

Posted: Wed Mar 14, 2012 12:32 pm
by chulett
You should have a couple of LINUX commands to change terminators in a file - dos2unix and unix2dos - use the latter after the file is created.