Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
1.00/5 (5 votes)
See more:
I have 5 text file. each record in each file contains two fields, city and salefigure.
i need create index in text file.
Posted
Comments
Richard C Bishop 21-Nov-12 10:11am    
Not a question. You need to provide code you have tried and ask a specific question to point out where you are stuck.
boyliberal2007 21-Nov-12 10:26am    
I don't known about this problem? please help me
OriginalGriff 21-Nov-12 10:26am    
And? What is your problem? Where are you stuck?
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.
[no name] 21-Nov-12 10:40am    
Since I read both your question you need to create a simple hash function so you can do integer searches
Nelek 21-Nov-12 17:34pm    
Please don't think we can read minds or do astral projections to see your monitor. If you need help, the least you could do is to add some relevant code to your question or to explain your problem in such a way, that the users of CP can understand it. Otherwise, nobody will be able to help you.
what have you tried?[^]

1 solution

According to Mathlab´s comment you can try to read all 5 text files to a hashtable/dictionary. Read them line by line, split each line into key and value and add them to the dictionary. The keys value has to be a list, because there may be more salesfigures for a city. Then write the dictionary to a text file.
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900