language agnostic - Text parser and output converter -


i want more efficient , save time when coding. here idea not know solution to: (note: beginner , open programming languages suggest.)

let´s assume have text data. have special chars @ beginning , @ end of keyword. firstly need parse text data , insert them text file.

for example this: have text

$method1$ §text1§ $method2$ §text2§ 

the text between chars $$(here method1 , method2) , text between §...§(here text1 , text2) found program , inserted template:

method1() { print.text1}; method2() { print.text2}; 

does such program exist? if not have no idea how approach making one. appreciate every hint , help.

you can make programming language believe. really, can use language like. prefer ruby this, perl great parsing type of thing. great if give sample of actual file parsing. really, programming language choice you, , whichever choose can google "regular expressions" , name of language figure out how it.

if did ruby can this:

text.scan(/^\s*$\s/) 

ruby reference:

parsing text in ruby

parsing strings , regular expressions in perl (good tutorial)

http://perldoc.perl.org/perlretut.html


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -