views:

85

answers:

2

I have the need to do some word wrapping with a few considerations:

1) Source file is MS WORD

2) Copy and paste the text into a textarea in a cfform.

3) Use

#wrap(theTextVar,80)#
to dump out the text 80 characters

4) The text is uploaded to a legacy system which needs ansi or ascii chars uploaded.

Everything seems to work okay, I just wanted to confirm see if anyone else has had luck doing this and if they know if a CR / LF is entered after each line in the outputted text (Step 3)?

+1  A: 

Tried this?

<cffile action="write" file="i_will_show_the_secret_if_you_open_me_in_text_editor.html" output="#wrap(theTextVar,80)#" />
Sergii
Thanks, that would do the same thing. I was concerned with what Ben Doom pointed out. Appreciate your reply!
Smooth Operator
+1  A: 

From the docs on wrap():

Uses the operating-system specific line break: newline for UNIX, carriage return and newline on Windows.

So if you are doing this on a Windows box, then the answer is yes.

Ben Doom
My Dev machine is OS X, but the production will be windows.. I must have missed the snippet above, thanks for pointing it out!Here's the cf 9 referencehttp://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7114.html
Smooth Operator