Subject: | |
From: | |
Reply To: | |
Date: | Sun, 27 May 2001 14:02:12 +0200 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
John wrote...
>I'm looking for a freeware application that will convert HP spoolfile or
>ascii files to an HTML format. This way I can put reports on our web site.
If you don't need fancy formatting, it can be as simple as adding
a few lines to copy the spoolfile over to a directory that is open
for access by the web server.
Just recently, I had a similar need. In my case the spoolfile did
have CCTL that tended to confuse my browser, so I added a step to
replace the ASCII NUL with a blank space...
!job example,user.acct
! ...
!print !hpspoolid.out.hpspool > tempA
!xeq /bin/tr "'\000' ' '" < tempA > tempB
!setvar targfile "/ACCT/PUB/public_hmtml/joblist.txt"
!xeq /bin/tobyte "-at TEMPB !targfile"
!xeq /bin/chmod "644 !targfile"
!eoj
The above gives access via http://my3000/~USER.ACCT/joblist.txt
After capturing the spoolfile content with PRINT, replacing
the ASCII NUL by spaces with /bin/tr, it converts to bytestream
format with /bin/tobyte (Posix apps like Apache do work better
with bytestream files than with fixed or variable ASCII records)
and opens up the permissions to rw-r--r-- so that the Apache web
server running outside my job account can still read the file on
web browser's behalf. (The public_html directory needs rwxr-xr-x
permissions for this to work).
Oh, and by naming the file with a .txt extension, Apache will
tell the browser to expect a MIME type of "text/plain" so that
I don't really have a perform any HTML conversion. The browsers
typically use a fixed-width font for displaying the text/plain
MIME type, so tabular output will retain columnar formatting.
Hope this helps. At least it worked for me ;-)
Lars.
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|
|
|