Might be overkill, but you could also use lua for this
Say your text file has a bunch of
name=value
statements
create a lua state
lua_dofile your text file
getglobal on each name you are interested in.
delete you lua state.
there's a bunch of other ways you could do it too, but that's probably the most straightforward.