Converting Text to HTML or XHTML

Converting Text to HTML or XHTML

5
NewbieNewbie
5

    Sep 28, 2009#1

    Hi,

    Does anyone know if there is a function in UEStudio which would convert a preformatted text file (arranged in paragraphs) to HTML or XHTML? I have looked around but cannot find anything.

    Cheers,

    Mark Foster

    6,675585
    Grand MasterGrand Master
    6,675585

      Sep 28, 2009#2

      There is no such command. But a small macro or script can make such a conversion. For example the following macro with property Continue if search string not found checked makes the first steps to convert a text into a HTML file. You can further adapt it to your needs.

      Code: Select all

      InsertMode
      ColumnModeOff
      HexOff
      UnixReOff
      Top
      TrimTrailingSpaces
      Find RegExp "%[ ^t]+"
      Replace All ""
      Loop 0
      Find "^p^p^p"
      Replace All "^p^p"
      IfNotFound
      ExitLoop
      EndIf
      EndLoop
      Find RegExp "[~ ^t^r^n]"
      EndSelect
      Key LEFT ARROW
      SelectToTop
      IfSel
      Delete
      EndIf
      Find MatchCase "&"
      Replace All "&"
      Find MatchCase "<"
      Replace All "<"
      Find MatchCase ">"
      Replace All ">"
      Find MatchCase """
      Replace All """
      Bottom
      Find RegExp Up "[~ ^t^r^n]"
      EndSelect
      Key LEFT ARROW
      Key RIGHT ARROW
      SelectToBottom
      IfSel
      Delete
      EndIf
      Top
      Clipboard 9
      CopyFilePath
      "<html>
      <head>
       <title>"
      Paste
      ClearClipboard
      Clipboard 0
      "</title>
      "
      IfColNumGt 1
      DeleteToStartofLine
      "</head>
      <body>
      
      <p>"
      Find "^p^p"
      Replace All "</p>^p^p<p>"
      Bottom
      "</p>
      
      </body>
      </html>
      "
      Top
      Find MatchCase "<title"
      Key RIGHT ARROW
      Find RegExp "[~<]+"
      Best regards from an UC/UE/UES for Windows user from Austria

      5
      NewbieNewbie
      5

        Sep 28, 2009#3

        Thank you once again.

        Mark Foster