Can you please provide me the java code to get a value of particulat string from a file

I am having following content in a file 'tempfile
$$STORENAME$ - "OMRON"
$$STOREMAIL$ - "customercare@omron.com"
$$STOREPHONE$ - "3144505678"


I want to print the values OMRON,customercare@omron.com by searching with strings $$STORENAME$ and $$STOREMAIL$

Can you please provide me the java code for this.
ukapu2005Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

doronbCommented:
You'll have to read the file line by line -- since I assume the file is built with two values in each line, separated by a '-'.

You can use java's StringTokenizer to separate each line you read its two arguments, or use the indexOf("-") method to get the index of the '-' character in every line, then use the substring(index) method to get the actual string for the token you're looking for.

If during this project (and others), you experience trouble writing your own code, we can help by looking at your code and offering solutions and code samples.
However, the policy of this site prevents Experts from simply writing code for you.  

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
doronbCommented:
Oh well.. there goes the Rule Book ;)
InteractiveMindCommented:
rules are to be broken ;)

but still, I don't believe that the rules state that we cannot produce code for someone.... to do like a whole project or something like that, is probably against the rules, but a couple of methods........
doronbCommented:
I'm not sure about the exact word of "The Law", but I think it states we're supposed to help, not spoon-feed... i.e. help someone figure out what's wrong with their code, or even offer a general approach, but not write someone code for them.
Mayank SPrincipal TechnologistCommented:
Actually, the format in which you have the data stored is in a slightly different format as compared to properties-files, otherwise that's what you need in this case because that's what they are meant for ;-)

http://www.javaalmanac.com/egs/java.util/Props.html

http://www.javaalmanac.com/egs/java.util/GetSetProps.html
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.