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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to download csv data directly to array?

Status
Not open for further replies.

cc4mail

Technical User
Jan 8, 2002
47
US
How can I download .csv data directly to an 2 dimensional array. a(date,open,high,low,close,volume)

I can download HTTP .csv data using an input box (but not to a variable) then write to csv file, and import to an array, but this is seems all unnecesary.


Why does the inputbox method work but:
var=inet1.openURL(HistoryURL) does not?
______

HistoryURL="
RichTextBox1.Text = Inet1.OpenURL(InputBox("URL", , HistoryURL))


Inet1.AccessType = icUseDefault
b() = Inet1.OpenURL(HistoryURL, icstring)
Open "d:\business\paul\emc.csv For Output As #1
Put #1, , ba()
Close #1

errors - malformed URL???
 
I corrected the input problem by adding len(). The write adds 4 bytes to the file, which also solves the variable problem. However, it is no longer a .csv file.

Inet1.AccessType = icUseDefault
bigString = Inet1.OpenURL(HistoryURL)
MsgBox Len(bigString)

Open "d:\business\paul\emc.csv" For Random As #1 Len = Len(bigString) + 12
Put #1, , bigString
Close #1

Any ideas on how to directly input to an array????
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top