infor.com
concierge
infor u
developer portal
documentation central
customer center
Posts
Categories
Groups
ERPs
CSD
FSM/HRT
LN
M3
Syteline/ CSI
Hubs
Developer
Healthcare
Hospitality
Public Sector
Onboarding
Release Center
CloudSuites
Aerospace & Defense (LN)
Automotive (LN)
Chemicals (M3)
Corporate (FSM/HRT)
Distribution (Sx.e/CSD)
Distribution Enterprise (M3)
Engineering & Construction (LN)
Fashion (M3)
Food & Beverage (M3)
Healthcare (FSM/HRT)
Industrial (Syteline/CSI)
Industrial Enterprise (LN)
Manufacturing (M3)
Public Sector (FSM/HRT)
Solutions
Supply Chain Management (SCM)
Human Capital Management (HCM)
Events
Groups
User Groups
Your Groups
About
Email Community Support
Infor News
Migrated Forums
Home
Clovertech
Clovertech Archive
Read Only Archives
Cloverleaf
Tcl Library
HTML to Plain Text Converter
James Mestack
Does anyone have any tcl code to replace html and insert proper spacing for HL7 OBX:5 fields in a result message? Need some help ASAP. Thanks.
Find more posts tagged with
Clovertech
Comments
david_barr
I would write a script to call an external utility. This one might work:
http://www.aaronsw.com/2002/html2text/
You can also install lynx and run "lynx -dump file.html > file.txt".
System
Originally posted by Chris Williams
Perhaps we have been lucky, but when we have encountered HTML or RTF from external systems, there has often been a configuration setting on those systems that will select plain text versus formatted as the output. Have you touched base with the system's vendor to see if that is an option?
There are a number of conversion routines available, however we have not found any that deal well with formatted items within the document, like multi-column tables, headers, footers and other items requiring specific positioning on the page.
Cheers.
James Mestack
Unfortunately, I am stuck on a windows box. Considering this, I was able to obtain lynx for win32, looks like it was compiled back in 99. But it appears to work if the html is stored in a file and I call it from the command line.
So this question may be related back to David to find out if he might know of a way to send lynx an html string in an exec call from a tcl script?
Can I approach it through tcl this way or is there a more efficient way?:
1) extract html from hl7 message and write to a test.tmp file.
2) set html_to_txt_variable [exec lynx.exe -dump test.tmp]
3) delete test.tmp file.
4) set new_hl7_txt_string [string map
$html_to_txt_variable]
david_barr
Yeah, those are probably the steps that you'll have to follow.
One nice thing about lynx is that it does a pretty good job preserve table layouts.