Loading ...
Sorry, an error occurred while loading the content.

Flags in Clips and RegEx

Expand Messages
  • querulus
    I thought I had posted this the other day, but I never saw it appear, so I ll try again. I ve got a large number of coded text files for typesetting that have
    Message 1 of 3 , Aug 7, 2012
    • 0 Attachment
      I thought I had posted this the other day, but I never saw it appear, so I'll try again.

      I've got a large number of coded text files for typesetting that have been marked up for a proprietary Greek font that I want to convert to Unicode. For example, a file may include the string <greek>abde</greek>. In type, this gets rendered with the Greek characters alpha+beta+delta+epsilon. I want to convert the string to the Unicode equivalent -- <0x03B1><0x03B2><0x03B4><0x03B5>. But my strings can contain _any_ Greek text, and I want to convert _every_ string <greek> . . . </greek> to its equivalent Unicode.

      I've got an old DOS text processing app from the 1980s (something called XChange from a place called Emulation Technologies) that can behave as a multi-string search and replace utility. As it scours a text file, it can set flags or conditions to control processing. So the string <greek> would set a flag greek=true, and </greek> would set the flag to false. The search and replace line would be something akin to this: if greek=true, then replace a with <0x03B1>, else replace a with a. Within my Greek font there are only 200 or so characters used, and each is a one-to-one match with a unicode character, so the actual search and replace should be simple, as long as I can do context-sensitive replacements.

      Can NoteTab do this?
    • John Shotsky
      Yes, easily. Regards, John RecipeTools Web Site: http://recipetools.gotdns.com/ From: ntb-clips@yahoogroups.com
      Message 2 of 3 , Aug 7, 2012
      • 0 Attachment
        Yes, easily.

        Regards,
        John
        RecipeTools Web Site: <http://recipetools.gotdns.com/> http://recipetools.gotdns.com/

        From: ntb-clips@yahoogroups.com [mailto:ntb-clips@yahoogroups.com] On Behalf Of querulus
        Sent: Tuesday, August 07, 2012 15:38
        To: ntb-clips@yahoogroups.com
        Subject: [Clip] Flags in Clips and RegEx


        I thought I had posted this the other day, but I never saw it appear, so I'll try again.

        I've got a large number of coded text files for typesetting that have been marked up for a proprietary Greek font that I
        want to convert to Unicode. For example, a file may include the string <greek>abde</greek>. In type, this gets rendered
        with the Greek characters alpha+beta+delta+epsilon. I want to convert the string to the Unicode equivalent --
        <0x03B1><0x03B2><0x03B4><0x03B5>. But my strings can contain _any_ Greek text, and I want to convert _every_ string
        <greek> . . . </greek> to its equivalent Unicode.

        I've got an old DOS text processing app from the 1980s (something called XChange from a place called Emulation
        Technologies) that can behave as a multi-string search and replace utility. As it scours a text file, it can set flags
        or conditions to control processing. So the string <greek> would set a flag greek=true, and </greek> would set the flag
        to false. The search and replace line would be something akin to this: if greek=true, then replace a with <0x03B1>, else
        replace a with a. Within my Greek font there are only 200 or so characters used, and each is a one-to-one match with a
        unicode character, so the actual search and replace should be simple, as long as I can do context-sensitive
        replacements.

        Can NoteTab do this?



        [Non-text portions of this message have been removed]
      • Axel Berger
        ... Easily, because it s well marked up. In a loop you can find all those strings and then do the 200 replaces on the highlighted text. Axel
        Message 3 of 3 , Aug 8, 2012
        • 0 Attachment
          querulus wrote:
          > Can NoteTab do this?

          Easily, because it's well marked up. In a loop you can find all those
          <greek></greek> strings and then do the 200 replaces on the highlighted
          text.

          Axel
        Your message has been successfully submitted and would be delivered to recipients shortly.