Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I was taking the data in a csv file and importing it to an array in vba.
The csv file has 1000 scenarios with 361 time intervals in each scenario - so there are 3,610,000 total rows. I want the array to be able to grab a scenario based on an input. So my first attempt was to skip the first scenarios until I got to the scenario that I wanted, then write to the array for 360 times. So if I wanted to pick up scenario number '34' I would write For i = 1 to (34 * 361) input #1, temp 'does nothing Next i For i = 1 to 360 input #1, Array(i) next i But can you use the "Seek" function to skip ahead to scenario 34 then start reading. Because the way I have it written seems like a waste because I start reading from the beginning each time - and I have to run a lot of scenarios so I need it to be as fast as possible. Thanks for your help on this |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Seek function returns a number that indicates where you are in the file.
Jeff wrote: I was taking the data in a csv file and importing it to an array in vba. The csv file has 1000 scenarios with 361 time intervals in each scenario - so there are 3,610,000 total rows. I want the array to be able to grab a scenario based on an input. So my first attempt was to skip the first scenarios until I got to the scenario that I wanted, then write to the array for 360 times. So if I wanted to pick up scenario number '34' I would write For i = 1 to (34 * 361) input #1, temp 'does nothing Next i For i = 1 to 360 input #1, Array(i) next i But can you use the "Seek" function to skip ahead to scenario 34 then start reading. Because the way I have it written seems like a waste because I start reading from the beginning each time - and I have to run a lot of scenarios so I need it to be as fast as possible. Thanks for your help on this |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
I have a read only xl file, I need it to be read and write | Excel Discussion (Misc queries) | |||
XCEL FILE REC'D AS READ ONLY -- HOW TO NOT BE "READ ONLY" | Excel Discussion (Misc queries) | |||
Pasword protected Excel file encrypted, how do I read this file? | Excel Discussion (Misc queries) | |||
How can a file be converted from Read-Only to Read/Write | Excel Discussion (Misc queries) | |||
"Unable to read file" error message when opening a Excel file that contains a PivotTable report. | Charts and Charting in Excel |