|
-
March 26th, 2001, 02:31 PM
#1
Please Help - Populating a grid with a tab delimited file...
I have to write VB functionality to read in a tab-delimited file and write the data to a cross-tabular grid. For example, the following data comes in the file "Name<tab>Class<tab>Grade". The name of each student would be in the left column, the class would be across the top row and the grades would be listed at their intersecting points.
So, I guess this is a 2-part question. (1) How do I read in the file so that it recognizes that it is tab-delimited? (2)Which grid control can I use to load the data in the manner that I suggested?
I am EXTREMELY greatful for any help that anyone can provide!!!
Thanks,
Ron
-
March 26th, 2001, 03:19 PM
#2
Re: Please Help - Populating a grid with a tab delimited file...
(1) How do I read in the file so that it recognizes that it is tab-delimited?
dim line() as string
Open "c:\YourFile.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, csvline
'This will split the line at the tab and put each element in the line() array.
line=split(csvline,vbTab)
'now do some calculation and put it into your grid
Loop
Close #1
(2)Which grid control can I use to load the data in the manner that I suggested?
It is a matter of preferances. I prefer MSFlexGrid
Iouri Boutchkine
[email protected]
-
March 26th, 2001, 03:23 PM
#3
Re: Please Help - Populating a grid with a tab delimited file...
Thanks Iouri -
Before I venture into the MSFlexGrid, is it possible to create a crosstab using this type of grid? ie. As per my example, I would need to have column headers and row headers and then data displayed at the intersecting points....
-
March 26th, 2001, 04:33 PM
#4
Re: Please Help - Populating a grid with a tab delimited file...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|