By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,654 Members | 1,599 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,654 IT Pros & Developers. It's quick & easy.

2 Dimensional Array value assignment

P: 1
Hello everyone,

I'm trying to create a program the reads from a CSV file, splits the comma seperated values and assigns them into a 2 dimensional array with the first dimension as line number(intLineCnt)and the second as the count of the comma seperated values. I believe my logic to be correct but I am unable to test because of a build error stating "Array subscript expression missing" on the 3rd line of code.
Expand|Select|Wrap|Line Numbers
  1.   Do While srBillFile.Peek > 0
  2.             strLine(intLineCnt) = srBillFile.ReadLine
  3.             aryLine(intLineCnt, ) = strLine(intLineCnt).Split(",".ToCharArray
  5.             intLineCnt += 1
  6.         Loop
So I guess my question is how do I assign the values to this array changing the first dimension for each line and the second for each CSV value for that line.

Any help would be appreciated.

Jun 11 '10 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.