- 0
(VB) Read Text File Into a 2 Dimensional Array
-
Recently Browsing 0 members
- No registered users viewing this page.
-
Posts
-
By seeprime · Posted
Doing that has only worked for me with the Enterprise version. -
By +mram · Posted
I like Neowin a lot, but this "article" is shady and misleading. We need an "editorial" flag and this isn't "news" it's "my cousin's dog's best friend posted on twitter about their snapchat account from their dog's owner that a bad thing happened, so it's NEWS." Thanks -
-
By Defiantly · Posted
Burrrrn. Bought COD WWII last month when it was on sale for PC. Oh well. Excellent game tho, and the PC version plays/looks amazing (and has it's own PC achievements). ...wondering if this is a lesson on waiting on sales. ...also hoping Rise of the Tomb Raider has it's own PC Achievements -
By Copernic · Posted
Google Chrome 137.0.7151.120 (offline installer) by Razvan Serea The web browser is arguably the most important piece of software on your computer. You spend much of your time online inside a browser: when you search, chat, email, shop, bank, read the news, and watch videos online, you often do all this using a browser. Google Chrome is a browser that combines a minimal design with sophisticated technology to make the web faster, safer, and easier. Use one box for everything--type in the address bar and get suggestions for both search and Web pages. Thumbnails of your top sites let you access your favorite pages instantly with lightning speed from any new tab. Desktop shortcuts allow you to launch your favorite Web apps straight from your desktop. Chrome has many useful features built in, including automatic full-page translation and access to thousands of apps, extensions, and themes from the Chrome Web Store. Google Chrome is one of the best solutions for Internet browsing giving you high level of security, speed and great features. Important to know! The offline installer links do not include the automatic update feature. Google Chrome 137.0.7151.120 changelog: [$7000][420697404] High CVE-2025-6191: Integer overflow in V8. Reported by Shaheen Fazim on 2025-05-27 [$4000][421471016] High CVE-2025-6192: Use after free in Profiler. Reported by Chaoyuan Peng (@ret2happy) on 2025-05-31 [425443272] Various fixes from internal audits, fuzzing and other initiatives Download web installer: Google Chrome Web 32-bit | Google Chrome 64-bit | Freeware Download: Google Chrome Offline Installer 64-bit | 128.0 MB Download: Google Chrome Offline Installer 32-bit | 115.0 MB Download page: Google Chrome Portable Download: Google Chrome MSI Installers for Windows (automatic update) View: Chrome Website | Release Notes Get alerted to all of our Software updates on Twitter at @NeowinSoftware
-
-
Recent Achievements
-
gatilogistic earned a badge
One Month Later
-
Custom Greek Shirts earned a badge
One Year In
-
Custom Greek Shirts earned a badge
One Month Later
-
Custom Greek Shirts earned a badge
Week One Done
-
topantidetectbrowser earned a badge
Week One Done
-
-
Popular Contributors
-
Tell a friend
Question
deck
I need to read a sequential data file into an array. I'm not where things are going wrong here. I keep getting an error "Input past end of file". I'm pretty certain my text file is good. Anyone tell me what I'm doing wrong? My text books aren't yielding the answers, nor is the internet thus far.
Dim strRecords(6, 5) As String
Dim product_list As String
Dim ProductList As Integer
Dim dataFile As String
Dim row As Integer
Dim col As Integer
dlgCommon.Filter = "DAT|*.dat|Text|*.txt|All|*.*"
dlgCommon.ShowOpen
product_list = dlgCommon.FileName
ProductList = FreeFile
Open product_list For Input As #1
Do Until EOF(1)
For row = 1 To 6
For col = 1 To 5
Input #1, strRecords(row, col)
Next col
Next row
Loop
And the text file...
"L666","SURGE PROTECTOR","PC KING",3.30,160,"N"<CR>
"M013","MS MOUSE","MEMORY-REX",23.22,28,"N"<CR>
"H013","20 GB HARD DISK","MICRO SHOP",190.90,18,"N"<CR>
"L005","17'' MONITOR","KING",205.00,4,"N"<CR>
"M713","56K BAUD MODEM","MEMORY-REX",99.00,88,"N"<EOF>
Thanks,
~D
Link to comment
https://www.neowin.net/forum/topic/251041-vb-read-text-file-into-a-2-dimensional-array/Share on other sites
5 answers to this question
Recommended Posts