I save pieces of data from my Cocoa application into a text file. The text file contains information as shown:
foo1 -> foo2
blah -> lwjef
hi -> bye
hello -> goodbye
Now the first part of each row is given by the user, but I need to get the part of each row after the ->. For example, if the user enters foo1, I want to output foo2 after parsing the text file. Does anyone know how to do this?
Parse once:
Then query for keys:
However, if the data originally came from your own application in the first place you should probably do this, instead of a custom (and insecure) string format: