Link to home
Start Free TrialLog in
Avatar of fylix0000
fylix0000

asked on

How can I parse a text file?

Hi all, I have a file call default.cfg , it is actually a simple text file with the following format:

#define ContactSurname=William
#define ContactGiven=Bob
#define ContactPhone=1234567890
#define ContactExt=123
#define EntityName=secret101
#define Street=12 street
#define City=San Francisco
#define Country=USA
#define Zip=123456

and so on and so on.

My question is, how could I create a java program to parse these values such that I could call

return findValue("ContactSurname") then my result would be "William"?
ASKER CERTIFIED SOLUTION
Avatar of BogoJoker
BogoJoker

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of fylix0000
fylix0000

ASKER

Thank you very much Joe, this solution is exact to the point and simple to do.........two thumbs up
Thanks, I'm learning how to answer questions better and better. =)