Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Seeking Matches in a Data Base
#2
Read the whole file once inside a two dimensional array.
Code: (Select All)
FOR i = 1 to 4500 'number of lines in the file... replace with a DO LOOP if necessary
   FOR j = 1 to 10
     INPUT #1, data_array(i,j)
NEXT j, i

That's now got all your data read and into your array.  You don't have to worry with the slowness of the file reading any more.  Now you just process it.

Code: (Select All)
FOR i = 1 to 4500 - 7 'going to compare the next 7 lines of data
   FOR j = 1 to 7 'the 7 lines we're going to compare
      FOR k = 1 to 10 'the 10 data elements that we need to compare in the first line of data
          FOR l = 1 to 10 'the 10 data elements that we need to compare
              IF data_array(i,k) = data_array(i+j,l) THEN   'we have a match
          NEXT
    NEXT
  NEXT
NEXT
Reply


Messages In This Thread
Seeking Matches in a Data Base - by Dimster - 07-03-2025, 04:00 PM
RE: Seeking Matches in a Data Base - by SMcNeill - 07-03-2025, 04:44 PM
RE: Seeking Matches in a Data Base - by Dimster - 07-03-2025, 08:08 PM
RE: Seeking Matches in a Data Base - by SMcNeill - 07-04-2025, 12:16 AM
RE: Seeking Matches in a Data Base - by Dimster - 07-04-2025, 06:24 PM
RE: Seeking Matches in a Data Base - by Dimster - 07-05-2025, 02:40 PM
RE: Seeking Matches in a Data Base - by SMcNeill - 07-05-2025, 04:33 PM
RE: Seeking Matches in a Data Base - by Dimster - 07-06-2025, 02:42 PM
RE: Seeking Matches in a Data Base - by SMcNeill - 07-06-2025, 04:23 PM
RE: Seeking Matches in a Data Base - by Dimster - 07-07-2025, 03:51 PM
RE: Seeking Matches in a Data Base - by Dimster - 07-13-2025, 12:26 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Must an extra value be provided on DATA statement? dakra137 11 1,046 09-30-2025, 05:38 PM
Last Post: ahenry3068
  Why is 'base' treated like a reserved word in the IDE? Pete 4 801 04-11-2025, 09:49 PM
Last Post: SMcNeill
  Change file data krovit 5 1,198 07-11-2024, 07:45 AM
Last Post: krovit
  Arrays In User Data Types Consolemu 2 867 01-18-2024, 09:49 PM
Last Post: bplus
  Write data to EXE file Steffan-68 8 1,998 05-15-2023, 06:41 PM
Last Post: Steffan-68

Forum Jump:


Users browsing this thread: 1 Guest(s)