Click here to Skip to main content
13,353,462 members (63,185 online)
Rate this:
 
Please Sign up or sign in to vote.
See more:
Hi all

I am having trouble trying to code a certain program and wondered if you could help. It uses an adress book in the form of a .txt file in the debug folder. The text file contains: a surname and first name, two lines of the adress and post code, a telephone number, date of birth, email adress.
I need to create a program to search this data file by surname to retrive and display the details for a contact. Also by date of birth to retrive and display all contacts with a birthday in a particular month.

I am using Microsoft visual basic 2010 express


Here is the .txt file:
Jackson Samantha,2 Heather Row,Basingstoke,RG21 3SD,01256 135434,23/04/1973,sam.jackson@hotmail.com
Vickers Jonathan,18 Saville Gardens,Reading,RG3 5FH,01196 678254,04/02/1965,the_man@btinternet.com
Morris Sally,The Old Lodge,Hook,RG23 5RD,01256 728443,19/02/1975,smorris@fgh.co.uk
Cobbly Harry,345 The High Street,Guildford,GU2 4KJ,01458 288763,30/03/1960,harry.cobbly@somewhere.org.uk
Khan Jasmine,36 Hever Avenue,Edenbridge,TN34 4FG,01569 276524,28/02/1980,jas.khan@hotmail.com
Vickers Harriet,45 Sage Gardens,Brighton,BN3 2FG,01675 662554,04/04/1968,harriet.vickers@btinternet.com


All help would be highly appriciated.
Thanks - Conor.
Posted 14-Jun-13 0:20am
Comments
ThePhantomUpvoter 14-Jun-13 5:24am
   
And what kind of help are you looking for? There is no question here or any kind of a description of a problem.
Conorthecoder43 14-Jun-13 5:26am
   
I'm just asking for someone to make the program with the task given, thanks.
ThePhantomUpvoter 14-Jun-13 5:58am
   
Well no one here is going to write a program for you. You would need to go to rentacoder for that and hire someone to write the code.
Richard MacCutchan 14-Jun-13 6:04am
   
With a name like "Conorthecoder43" I would assume you could do this in an hour or less.

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

I would:
  • Parse the file (it is simple, read a line at time and use String.Split to retrieve its different field values).

Then either:
  • Store the parsed info inside a database and use such database for searching, etc...

or
  • Maintain such data in main memory (if feasible) and perform the seraching operation using it.


Note: with a DataSet you may actually take advantage of the database facilities without having an actual database connection.
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy |
Web04 | 2.8.180111.1 | Last Updated 14 Jun 2013
Copyright © CodeProject, 1999-2018
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100