Ok, I am def a beginner in writing code (use to be ok, but haven't done it in soooo long, so I am very rusty). Let me give a little background about the program I am trying to write before I get to my question so that it makes a little more sense. I work in a jewelry store for my uncle, and I am trying to write a program that will help us search our repair jobs. As of now, to organize everything, I make each customer a folder named as their name (ie Mike Smith). Inside their personal folder I save a notepad file named their name (ie Mike_Smith.txt). In that text file, I include information such as the job #, telephone #, description of the pieces, charges, take in date, ready date, and location of the repair job. It has been working really well, except for the fact that we have to know the customers first name to be able to find any information. An example of how this is a problem is a repair needed a piece of jade replaced, but we could not remember who the customer was. With having at least 3,000 customers, and a few hundred repair envelopes at a time, you can see how this is so difficult to keep track of. I have the code written for the cout statements, as well as the cin. What I need it to do is if I type in a keyword such as Jade, the customers name, or job number, it will open that .txt file, that I have already created for the customer. I have been searching everywhere for the right direction to take with this, a starting point, or even an example but I come up empty handed. If anyone can help me with this, I wouldn't be able to thank you enough. So far with the folders I have cut the search time from a few hours, to like 15-30 mins which is HUGE, but if I can finish this program, I believe the search will be cut to instant, which will make my life SOOOO much easier! Thank you in advance to anyone that may be able to help!
Recommended Answers
Jump to PostThe MS Windows search function would let you find things in text files quickly like that.
Other than that, what compiler are you using?
It would be easier done in C++/CLI if at all possible.
Jump to PostThe MS Windows search function would let you find things in text files quickly like that -- assuming you're using Windows.
Also, since you mentioned "cout", another assumption is that you're doing this from the command-line.Other than that, what compiler are you using?
It would be easier done …
Jump to PostCreate two index files, perhaps?
keywords.idx for keywords with each line containing: keyword path, [ path... ]
jade aaron_rogers.txt brett_favre.txt calvin_johnson.txt
amethyst jahvid_best.txt mathew_stafford.txt
urgent tom_brady.txt tony_romo.txt
// etcordernumbers.idx with each line containing: ordernumber path
10237 aaron_rogers.txt
11384 brett_favre.txt
etc.On program startup read keywords.idx into a std::map< std::string, …
All 9 Replies
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.