Working with delimited files

teamdad

Member
Joined
Jun 14, 2004
Messages
12
Programming Experience
Beginner
This may be dificult but here goes. I have a delimited file that I need to read/open in a RichTextBox that I have on a program, it looks like Windows Notepad. Once the file is opened in the program it needs to filter out what I don't want and just focus on what I do want. In the program it will calculate the number of occurances of a number that's in the file. An example of the first 5 lines of my data file is below.
all I need it to focus on is the set of numbers grouped like 5,11,29,47,50 and 17 from the first line in the file. The rest I don't want it to count/calculate or pay attention to.

9-6-1996; : 5,11,29,47,50; Money Ball: 17
9-13-1996; 3,4,9,30,47; Money Ball: 1
9-20-1996; 5,24,31,34,48; Money Ball: 6
9-27-1996; 8,25,35,37,48; Money Ball: 8
10-4-1996; 8,16,18,36,38; Money Ball: 1
10-11-1996; 2,23,37,40,50; Money Ball: 22

Anyone know where I can start with this? i'm running vb.net 2005 express by the way.
Thanks in advance to anyone that can help me.
 
You're not being very specific about "what you want".
I guess the best approach is to read the input file line by line into an array (lines).
Do some string manipulation (string.split() seems appropriate) on each line to retrive only the numbers, again into an array (numbers).
Then work the numbers array to calculate the statistics.
Now you should have the info needed to display only those lines or numbers you're after in the RTB.
If you change you mind about for instance what occurence level to filter out, it should be easy to retrieve a new line/number set from the statistics already done.
 
Database table

I would lean toward creating a database table from the data. Whatever your database backend is, most will have some form of file transfer method to create a table from delimited files. Even if it is just reading it into an excel spreadsheet. Once the data is broken down into fields (as it appears it was intended) it would be much easier to manipulate the data (sort, predict/forcast, etc...).
You certainly can start chopping up strings and get what you want, Just think about letting a wizard do the work for you.

Hope this helps...
 
Back
Top