I have a very large comma delineated text file of words, letters and numbers. This would be the "book" for the cypher.
I want to write software that can take text input and use the book to convert it to numbers that can then be safely sent to another.
The receiver of the note can run the same software with an identical "book" to change the numbers into text.
He can then send an answer to the sender using the software to turn his words to numbers.

So the software has to count the number of words in the "book" up to and including the the word, letter or number that is to be encoded
and put that number down in text format to make the encoded note.
The software is then used by the receiver to count words in the "book" up to the number on the note and output the word
building the note as it goes.

As I see it the software opens the text file in read only status and for each word it has to read the document, keep track of the number of words read,
and depending on the process, decoding or encoding, performs the write to a text file it open to append.
The only difference between the two operations is whether it writes a word or a number to the text file.
I think I will have to rewind the pointer for each word or number, set a variable to designate encode or decode, and of course share the "book" with those who use the process.

Am I missing anything?