![]() |
| ||
| how to read data from text file into data grid??? i need to create a system to read the txt file data to datagrid but i just know read by line. that say the sample.txt file pettern as below: date time price 1/8 2:15pm $5.00 2/8 3:20pm $6.00 how i going to fill the data separate by date, time, and price?? means read by row n column....n fill into datagrid.... thanks.... if got sample to show then will be more better....:lol: |
| ||
| Re: how to read data from text file into data grid??? Hi It looks like you have a set of " " between the columns, so what i would do is split each line one at a time, something like this:
that will create an array with the data what you want. Probably you will have to trim each line to get rid of the empty spaces. Hope it helps Regards |
| ||
| Re: how to read data from text file into data grid??? if the text file data is seperate by symbol ":" then how i going to do sample data RX:12/3/06:SS1112:483720:E RX:12/3/06:SS1113:483721:-E |
| ||
| Re: how to read data from text file into data grid??? Then you split the array when ":" is found.
regards |
| ||
| Re: how to read data from text file into data grid??? Dear williamrojas78, ohohling may i know how to read the data from the array? after assign the txt line into the array by the code above. how can i take 1 by 1 and put it into datagrid? thanks a lot |
| ||
| Re: how to read data from text file into data grid??? Hi, Here it is; first you read the array, then you read line by line and after that you place it in the grid. myArray = Split(line, ":")Dim myArray As Array Hope it helps |
| All times are GMT -4. The time now is 7:49 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC