Preserve formating in with httprequest

Technical support and scripting issues

Moderators: JRL, Dorian (MJT support)

Post Reply
kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Preserve formating in with httprequest

Post by kpassaur » Wed May 28, 2008 12:38 pm

I am trying to use httprequest to obtain the data in a plain text file. Not an HTML file.

I can get the file but it loses its formating. Is there any way to preserve the formating when getting a text file in this manner?

I don't want to open the file and select all, copy and paste, I want it to silently get the data. What it appears to be is just figuring out what hapens to the Carrigage returns and line feeds and replacing them.

The sample code is below, in order to test it the folder c:\temp must be present

DeleteFile>c:\temp\testpullsite.txt
HTTPRequest>http://www.eia.doe.gov/pub/oil_gas/petr ... MLResponse
StringReplace>%HTMLResponse%,%CR%,%CRLF%,HTMLResponse
Writeln>c:\temp\testpullsite.txt,result,%HTMLResponse%
ExecuteFile>c:\temp\testpullsite.txt,result

Me_again
Automation Wizard
Posts: 1101
Joined: Fri Jan 07, 2005 5:55 pm
Location: Somewhere else on the planet

Post by Me_again » Wed May 28, 2008 1:48 pm

Unix type files have an LF, not a CR so the string replace needs to be:

StringReplace>%HTMLResponse%,%LF%,%CRLF%,HTMLResponse

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts