Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Input data from a txt file into a matrix 1

Status
Not open for further replies.

gadget3302

Programmer
Apr 24, 2003
79
US
I want to take rows of numbers from a text file, break the numbers into two digit numbers and then store the numbers in a matrix inside my VB program. I have no idea how to even begin this project. Any suggestions, pointers, code would be greatly appreciated.

Thanks


Brian
 
Sounds fun. The first solution I came up with is using a recordset (to read the .txt file into VB) and a multi-diminsion array (to act as the matrix). If you always know the size of the matrix, you can hardcode both dimensions, if not, make it a run-time multi-dimension array. If you want to show something visual on the screen, also look into data or flex grids. Hope that helps with a starting place.
 
first search the forums for
file read input EOF
in order to open and load the file.

then search for dim (eventually redim) array and also for "for" and/or "while" and "loop".

Also search (MSDN area) for help on arrays as you are going to need it


Then comeback with whatever code you have tried so far and we will help further.

Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top