Video Screencast Help
Give us your opinion and win with Symantec! Please help us by taking this survey to tell us about your experience with Symantec Connect, so that we can continue to grow and improve.  Take the survey.

maintain Formatting

Created: 30 Oct 2012 • Updated: 01 Nov 2012 | 12 comments
This issue has been solved. See solution.

Hi

Has anyone been able to write a file and maintain the formatting ?

I have a form that users fill in and using a merge html - HTML to text - create text file - write file.  all i get in the file output is a string with no formatting?

I only need three carraige returns in the start of the string to accomplish my goal , does anyone know a way of acheiving this?

Regards  C

Comments 12 CommentsJump to latest comment

b3tts32's picture

The only way I've ever been able to get this to work is to use the append text file component to add each new line I need. So it would be somemthing like create text file > write file > append file > write file > append file > write file.

carlsson's picture

Hi Thanks

I've cobbled together a flow similar to what you describe but...

keep getting "cannot find temp file path".

C

Hojiblanca

reecardo's picture

I'd see if there's a system variable for TEMP defined on your system.

carlsson's picture

Hi Reecardo

Thanks for the reply

There is a sytem variable defined for TEMP

it seems to fall over when I "append to text file" with an error "illegal characters in path", I'm adding the append text as a constant.

C

Hojiblanca

carlsson's picture

My model looks correct but I get this error

Could not find file 'C:\Program Files\Symantec\Workflow\Designer\bin\tmpD63F.tmp'."

Here is my flow

Hojiblanca

b3tts32's picture

So is your second create text file something different than what you're appending the text to is the component before it? If not, you can bypass that and go directly to your write file component. Also, I'm writing my file to a full path location so that may be why I'm not getting any conflicts. I just have a temp directory on my workflow server that create and delete a bunch of temp batch/ps1 files and what not. My model looks like this..

carlsson's picture

Hi Thanks for sharing your flow , although what are the components not shown on the right after the "append to text" etc ?

I've modified it again and get this in the debug log

EndDate = 01/11/2012 15:19:49
ErrorMessage = "Illegal characters in path."
Forename = "e"
GATEWAY_INTERFACE = ""
HTTP_ACCEPT = "text/html, application/xhtml+xml, */*"
HTTP_ACCEPT_ENCODING = "gzip, deflate"
HTTP_ACCEPT_LANGUAGE = "en-GB"
HTTP_CONNECTION = "Keep-Alive"
HTTP_HOST = "localhost:7781"
HTTP_USER_AGENT = "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)"
HTTPS = ""
HTTPS_KEYSIZE = ""
HTTPS_SECRETKEYSIZE = ""
HTTPS_SERVER_ISSUER = ""
HTTPS_SERVER_SUBJECT = ""
INSTANCE_ID = ""
INSTANCE_META_PATH = ""
LastComponent = "Append Line To Text File"

Illegal characters in path ?  only letters in the path for the append

C

Hojiblanca

b3tts32's picture

Whoops sorry I'm not sure why it cut it off, you can right click and do open in new tab/window and it should show the whole picture.

Strange that you're getting that error still, can you simplify it just a bit to isolate the issue. I've included a simple package that that should test the functionality. Just change the .doc to .package and you should be able to open it from your server.

AttachmentSize
test3.doc 1.31 MB
SOLUTION
carlsson's picture

Why is this needed to keep formatting in a text file?

Just seems overly complex

C

Hojiblanca

carlsson's picture

Thanks I'll give it a try and let you know

C

Hojiblanca

carlsson's picture

Awesome!!!   Thanks that works smiley

the app that I'm sending the file to doesn't allow a string so I have to format the header of the text file exactly.

Which is why i need to do this ....but what a lot of effort???   just for this

Thanks  C

Hojiblanca

b3tts32's picture

Yeah it's certainly a headache especially when you have multiple lines but I guess as long as it works.. haha.