|
-
Apr 22nd, 2000, 09:47 PM
#1
Thread Starter
Addicted Member
I am not familiar with textfile or databases, so I have a question about this: I have a textfile from about 5 Mb with contains records. Now I will search in the file for certain words and if the word exist in a record then put the record and/or records in a new file or listbox. Who can help me with a example ??
-
Apr 23rd, 2000, 07:07 AM
#2
Fanatic Member
I can,
Some more info please, Is the File DB only text or does it contain binary data too? Do you know if the record size is static (so we can match it with a User Type and use random access for records) or delimited (in which case being 5mb you'd be better off with binary arrays and split functions).
Hear from you soon
Paul
-
Apr 23rd, 2000, 03:38 PM
#3
Thread Starter
Addicted Member
Hello Paul,
The file have no delemiters and is only text. Until now I search with a 'GREP' method, but I think it must be better with VB. A record contains:
- number (10)
- description (25)
- price1 (10)
- price2 (10)
- info (25)
- reserve (10)
If you need more info you can email me: [email protected]
regards, Kars
-
Apr 23rd, 2000, 05:01 PM
#4
Fanatic Member
Well you have no problems then.
You can check MSDN for more details under Random File Access,
Code:
' Module
Public Type Product
pNumber as String * 10
pDescription as String * 25
pPrice1 as String * 10
pPrice2 as String * 10
pInfo as String * 25
pReserve as String * 10
End Type
Public Products() as Product
' Form
Open "LensenDB.Dat" for Random as #1 Len = 90
then use Get() to get the records
The other alternative if this is too slow because the DB is too big, load it all into a binary array and split records with mod 90
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|