HELP: pair-value search & replace
-
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?
-
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?
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
-
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?
I would use
awk
(just because I know a bit it). Go withLua
(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] -
I would use
awk
(just because I know a bit it). Go withLua
(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]I was hoping you give a Haskell example. :)
-
I was hoping you give a Haskell example. :)
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]