Compare the task at hand to a multilingual dictionary. You look up a word and get its translation into another language. The same holds true here.
You need to build a table for your comparisons.
Code:
struct lookuptable
{
char *from;
char *to;
} table[] =
{
{ "dog", "cat" },
{ "bird", "fish" },
{ "tree", "rock" },
{ "I", "am" },
{ "so", "tired" },
};
Then you figure out what your delimit is, or however you break your file for translation, and read the first "from", and send to your output stream it's "to".
Quzah.