RTF to Plain Text

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf RTF to Plain Text

  • Creator
    Topic
  • #49855
    Deanna Norman
    Participant

      Hi,

      Any simple or non simple way to convert RTF to Plain Text from Cloverleaf / TCL?

      Thanks,

    Viewing 0 reply threads
    • Author
      Replies
      • #63884
        Phil Costner
        Participant

          I have used regsub to remove the RTF control words from the RTF document.  Here are some of the commands that I used to parse the RTF document.  

          regsub -all — {~|B~} $obx5 {} obx5

          regsub -all — {B*Bblipuid [a-z0-9]+}[a-z0-9]+} $obx5 {} obx5

          regsub -all — {Bs[nv] [a-zA-Z0-9]+} $obx5 {} obx5

          regsub -all — {Bexpnd0Bexpndtw-3Binsrsid[0-9]+ PRIVATE } $obx5 {} obx5

          regsub -all — {B*Bdatafield [0-9a-z]+} $obx5 {} obx5

          regsub -all — {B[a-z0-9 ]+DOCPROPERTY “[A-Za-z]+” B+* MERGEFORMAT } $obx5 {} obx5

          regsub -all — {B*Bbkmk[a-z]+ [A-Z0-9a-z_]+} $obx5 {} obx5

          regsub -all — {B*B[a-z-0-9]+} $obx5 {} obx5

          regsub -all — {Brquote } $obx5 {‘} obx5

          regsub -all — {Bpard} $obx5 {} obx5

          regsub -all — {Bpar } $obx5 {~} obx5

          regsub -all — {B*} $obx5 {} obx5

          regsub -all {B[a-z0-9]+ >} $obx5 {} obx5

          regsub -all {B[a-z]+ .} $obx5 {} obx5

          regsub -all {B[a-z]+ (} $obx5 {} obx5

          regsub -all {B[a-z]+ )} $obx5 {} obx5

          regsub -all — {B[a-z-0-9]+} $obx5 {} obx5

          regsub -all {{} $obx5 {} obx5

          regsub -all {}} $obx5 {} obx5

          regsub -all {\’b[a-z0-9]} $obx5 {} obx5

      Viewing 0 reply threads
      • The forum ‘Cloverleaf’ is closed to new topics and replies.