Read text file into variable

I am trying to read a text file into a variable, then output the variable in the email body as HTML.

%var%

But i found that it always print everything into one line, even though the text file content has several lines. Is there anything i can do to have proper formmating?
Thanks

Seems to work for me (I read a multiline text file into a variable, then displayed the variable in a MessageBox action.)

Is it possible that the action you are using to view the variable is not allowing you multiple lines? How are you using the variable data?

Thanks for the reply.

Yes, i tried using message box, it works fine.
What i am trying to do is:
- Run .exe, output result to a text file
- Read text file into a variable
- Send Email with HTML formmatted message, in the body of the email, i'll use the variable like this:


%VAR%


Am i missing something? or any workaround? Thanks

I mean i’ll have
TR tag
TD tag %VAR%
close TD tag
close TR tag

Hi Sherry,

HTML doesn’t respect newlines, it ignores all whitespace.

To work around the problem, replace all the newlines with BRs. An easy way to do this is to put the following JScript into the BeforeAction event of the Send Email action:

VAR=VAR.replace(/\n/g,‘BRTag’);

(BRTag should be a BR html tag. The forum software has a bug which currently won’t let us escape < and > properly. Should be fixed soon, though.)

Thanks for the reply. It's working.