Click here to Skip to main content
15,890,185 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
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
Comments
[no name] 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.
[no name] 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

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.
 
Share this answer
 

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