Retrieve data from text file that is contained within headings

wilson208

Member
Joined
Jun 21, 2011
Messages
9
Programming Experience
Beginner
Hi, I am making a simple application that will be able to store competition data into a text file that I have given a custom extension to on saving. Here is an example of the format that i have saved the data in.

VB.NET:
[Comp_Name]Test Competition[\Comp_Name]
 [Location]Silverwood Lurgan[\Location]
 [Type]Teams[\Type]
 [AgeGroup]Under17[\AgeGroup]
 [Date]16/02/2012[\Date]
 [Duration]3[\Duration]
 [Entries]20[\Entries] 
[LanesAvailable]5[\LanesAvailable]
When i open the file, i want to redisplay the data in separate text boxes. Later on in the project i want to be able to search within the file for headings for example;

if "[Heat1]" is present then get all text between [Heat1] and [\Heat1]

i am currently able to use the streamreader and open file dialog to retrieve the entire string of text fromthe however i am not sure how to go about getting the text between the headings I have used. Any help or general guidance would be greatly appreciated.
Many thanks, Wilson.
 
May I suggest you look into the Xml format instead? I think you will find it familiar, and with established .Net tools to go with it as well.
 
Back
Top