3 Replies - 850 Views - Last Post: 25 March 2010 - 04:50 PM Rate Topic: -----

#1 tootypegs   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 239
  • Joined: 09-October 07

searching lots of data

Posted 25 March 2010 - 04:52 AM

Hello, its been a long time since Ive attempted some programming and been on here so I hope you can forgive me. My question involves searching large amounts of data. I havnt started my programming yet so I'm not asking anyone to do it for me or anything I am just simply after advice on how to go about this task. I want to search through a huge list of keywords (list a) and see if any of the match the next list of keywords (list B). At the finish I want to export all matches to another summary file (list c).

Im comparing a huge amount of data therefore I really need to attempt this in the most efficient way. I was thinking about putting both lists into spreadsheets and preform some type of comparison on these however Im not sure how well this is going to work. Are there any better methods of doing this such as databases and how possible is this in C++

Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: searching lots of data

#2 Martyn.Rae   User is offline

  • The programming dinosaur
  • member icon

Reputation: 557
  • View blog
  • Posts: 1,438
  • Joined: 22-August 09

Re: searching lots of data

Posted 25 March 2010 - 05:10 AM

When you say huge amounts of data, could you give us estimates - kilobytes, megabytes or gigabytes? C++ is well capable of handling all of those.
Was This Post Helpful? 0
  • +
  • -

#3 taylorc8   User is offline

  • B&

Reputation: 150
  • View blog
  • Posts: 1,572
  • Joined: 21-July 09

Re: searching lots of data

Posted 25 March 2010 - 04:46 PM

Are the lists sorted? Some algorithm wizard may know a good tactic..
Was This Post Helpful? 0
  • +
  • -

#4 eker676   User is offline

  • Software Engineer
  • member icon

Reputation: 379
  • View blog
  • Posts: 1,833
  • Joined: 18-April 09

Re: searching lots of data

Posted 25 March 2010 - 04:50 PM

Well I knew there was a function for this in the standard template library so I glanced at some reference:
http://cplusplus.com...t_intersection/

And bingo!

Read both sets of data into vectors, create a third vector, use the set_intersection() function and write the third vector to the file.
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1