CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2001
    Location
    Rhode Island
    Posts
    56

    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


  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    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]
    Iouri Boutchkine
    [email protected]

  3. #3
    Join Date
    Mar 2001
    Location
    Rhode Island
    Posts
    56

    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....


  4. #4
    Join Date
    Mar 2001
    Location
    Rhode Island
    Posts
    56

    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
  •  





Click Here to Expand Forum to Full Width

Featured