Text files from web servers--Say it ain't so!

Jerry Muelver jerry at hytext.com
Thu Jan 5 18:55:41 EST 2006


----- Original Message ----- 
From: "Devin Asay" <devin_asay at byu.edu>

> I've spent the better part of two days coding a utility designed to  pull 
> log files (plain ascii text) off a web server, then parse the  contents 
> for a report. After initially testing the concept with local  files, today 
> I realized that when you use the 'get URL "http:// 
> myserver.com/myfile.log"' form it STRIPS ALL RETURNS out of the file!  I 
> must have known this before, but it slipped my deteriorating mind.  Before 
> I recode my utility, can someone tell me, is it possible to  pull a text 
> file off a web server using the http protocol and retain  the return 
> characters?

I think the returns are there, but are converted to spaces by the browser, 
since that's the HTML way.
I would try:
<code type=xtalk>
get URL "http://myserver.com/myfile.log"
put it into myText
put "<pre>" before myText
put "</pre>" after myText
</code>
Then save myText to a file with a ".htm" extension, and point the browser to 
the file.

---- Jery Muelver 




More information about the use-livecode mailing list