cancel
Showing results for 
Search instead for 
Did you mean: 

New line character in notepad using UDF and mail package

Former Member
0 Kudos

Hi experts,

in my scenario I'm sending mail from ECC to several address using a receiver mail adapter with mail package.

I'm using mail package cos I need to dynamically set field To, From and the Name of the file attached.

The file attached is and must be a txt file.

I'm using UDF to populate content field of mail package.

I need that in the attachment file every record is in a new line, for example 15 record -->> 15 lines, like this:

record 1

record 2

record 3

.....

The problem is:

If I open the file with word pad, ultraedit, word, or another similar editor is ok, but if I open with notepad (standard editor when double click) all the record are in one line, separated by a little square box, like this:

record1 <square box> record2 <square box> record3 <square box>.....

Why with notepad I don't see 1 record per line? how to solve this problem?

below the UDF that I'm using to populate content field of mail package:

public void CreateContent(String[] a,ResultList result,Container container){

AbstractTrace trace = container.getTrace();

String str = "";

for(int i=0;i<a.length;i++)

{

if(i == (a.length-1))

str = str + a{i};

else

str = str + a + "\n" ;

}

result.addValue(str);

}

////Please consider that curly bracket square bracket as for standard Java array elements,the problem is when I post it on SDN,index element goes off.

I also tried to use "\r\n" or "\r" or "\n\r" (every possible combinations...) instead of "\n" but problem still remains.

Thanks

Fabio Boni

Edited by: Fabio Boni on Sep 4, 2010 1:54 PM

Accepted Solutions (1)

Accepted Solutions (1)

former_member192295
Active Contributor
0 Kudos

Hi,

I think this is common problem (not problem ) with notepad. Most of the time we can select Wordpad as default editor to prevent ths problem. I think we don't have alternative solution for this.

Answers (1)

Answers (1)

stefan_grube
Active Contributor
0 Kudos

> Why with notepad I don't see 1 record per line?

Notepad shows newline correcly only for files created on Windows. I suppose your PI is running on Unix or other OS.

> how to solve this problem?

Make Wordpad your standard editor.

Former Member
0 Kudos

Hi,

thanks for the answer.

mi PI is Windows.

The problem is not my standard editor, but the standard editor of who receive the mail, I cannot tell to everybody to change their standard editor.

Thanks

Fabio Boni

Former Member
0 Kudos

> I cannot tell to everybody to change their standard editor.

If there is a requirement then you have to tell the receiveing person at least.

stefan_grube
Active Contributor
0 Kudos

> The problem is not my standard editor, but the standard editor of who receive the mail, I cannot tell to everybody to change their standard editor.

You wrote: "If I open the file with word pad..."

Is it so difficult to describe the issue that you have so exactly, that peoble can help you?

Former Member
0 Kudos

>

Why with notepad I don't see 1 record per line? how to solve this problem?

Hi,

this is the problem, seems so clear.

To use wordpad as standard editor is not an answer, neither for me, nor for other people who receives mail.

No solution is a better answer.

Best Regards

Fabio Boni

Edited by: Fabio Boni on Sep 6, 2010 10:46 AM

Edited by: Fabio Boni on Sep 6, 2010 10:47 AM