Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. HELP: pair-value search & replace

HELP: pair-value search & replace

Scheduled Pinned Locked Moved C / C++ / MFC
c++perllinuxalgorithmshelp
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    andwan0
    wrote on last edited by
    #1

    Does anyone know to quickly make a multiple search & replace app (in either C or C++)? Am not interested in searching multiple files, just one file. I want to translate a list of unicode characters into something else (pair-value lookup table) ... so it's basically a crude/naive translator! I just need a quick pseudocode to get me started. Or maybe there's an opensource/free code already written? PS: Or maybe it's easier quicker with sed/awk/perl?

    M CPalliniC 2 Replies Last reply
    0
    • A andwan0

      Does anyone know to quickly make a multiple search & replace app (in either C or C++)? Am not interested in searching multiple files, just one file. I want to translate a list of unicode characters into something else (pair-value lookup table) ... so it's basically a crude/naive translator! I just need a quick pseudocode to get me started. Or maybe there's an opensource/free code already written? PS: Or maybe it's easier quicker with sed/awk/perl?

      M Offline
      M Offline
      Moak
      wrote on last edited by
      #2

      Look like a FAQ question for any programming language. While this needs some C/C++ copy and paste skills, it's a Perl/Python/Lua/sed/awk three liner with regular expression. There is probably a very elegant monad transformer in Haskell too (that nobody understands). :) What have you tried so far? /M

      Chat in Europe :java: Now with 24% more Twitter

      1 Reply Last reply
      0
      • A andwan0

        Does anyone know to quickly make a multiple search & replace app (in either C or C++)? Am not interested in searching multiple files, just one file. I want to translate a list of unicode characters into something else (pair-value lookup table) ... so it's basically a crude/naive translator! I just need a quick pseudocode to get me started. Or maybe there's an opensource/free code already written? PS: Or maybe it's easier quicker with sed/awk/perl?

        CPalliniC Offline
        CPalliniC Offline
        CPallini
        wrote on last edited by
        #3

        I would use awk (just because I know a bit it). Go with Lua (check out the LPeg[^] library) to experience real power. :)

        If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
        This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
        [My articles]

        In testa che avete, signor di Ceprano?

        M 1 Reply Last reply
        0
        • CPalliniC CPallini

          I would use awk (just because I know a bit it). Go with Lua (check out the LPeg[^] library) to experience real power. :)

          If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
          This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
          [My articles]

          M Offline
          M Offline
          Moak
          wrote on last edited by
          #4

          I was hoping you give a Haskell example. :)

          Chat in Europe :java: Now with 24% more Twitter

          CPalliniC 1 Reply Last reply
          0
          • M Moak

            I was hoping you give a Haskell example. :)

            Chat in Europe :java: Now with 24% more Twitter

            CPalliniC Offline
            CPalliniC Offline
            CPallini
            wrote on last edited by
            #5

            Sorry man, I don't know Haskell. :)

            If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler. -- Alfonso the Wise, 13th Century King of Castile.
            This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong. -- Iain Clarke
            [My articles]

            In testa che avete, signor di Ceprano?

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups