Jump to content

Easy and fast database type needed


Recommended Posts

I have a list of 9331 entries in a text file right now, and need to check each of those 9331 entries against 15-30 entries to see if they match. I currently have all the 9331 entries in a text file, and would like to know what the "pros" use for database and how I can use it too. Currently, this is my script, and the way my "database" is formatted:

$fl = FileOpen(@scriptdir & "\database.txt", 0)
$file = FileRead($fl, FileGetSize(@scriptdir & "\database.txt"))
FileClose($fl)
$flspl = StringSplit($file, @CRLF, 1)
For $i = 1 to $flspl[0]
    $flspl[$i] = StringSplit($flspl[$i], "|")
Next
For $x = 0 To $count
    $txt =;text item to check against
    $flnm =;filename for each item to check against
    For $i = 1 to $flspl[0]
        $var = $flspl[$i]
        if $var[1] = $txt Then
            If $var[2] = "Y" Then
                If StringInStr($flnm, $var[3]) Then
                ;whatever
                EndIf
            EndIf
            If $var[2] = "U" Then
                If StringInStr($flnm, $var[3]) Then
                ;whatever
                EndIf
            EndIf
        EndIf
    Next
Next

Database.txt

Item name|Y|Filename|Description
Who else would I be?
Link to comment
Share on other sites

Databases are great for handling large amounts of data, and querys.

If you put them into two database tables, you could do many things almost instantly, like show what matches, what doesnt', etc.

One thing about databases, is that you can have rules set up so that you never duplicate data.

I don't exactly know how you are comparing or verifying, nor how many databasesyou have access to, but even with none, you can use autoit beta to dump the file into an access database, and the second file as well and do an SQL querry on it.

MySQL is also free, and you can do things like this fast and easy from a php form as well.

A little server already set up with PHP, MYsql, MSQLadmin, etc is available in one zip file at:

http://miniserver.sourceforge.net/

handy and no install, just unzip.

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to comment
Share on other sites

The main question of the day: is this going to be faster than 115ms per item that I am experiencing as of right now?

Next question: Where do I get started in allowing autoit to connect to and access (among adding to) such a database?

EDIT: I realise I have opened up a can of worms without specifying the circumstances under which this database will be accessed. This database will have a local copy on a CD and will be accessed by autoit to compare to the local pc's information. This action will be run on about 20 PCs a day. Therefore, I need to have the database be accessable by autoit using a dll or something similar with as minimal configuration as necessary on the PC in question.

Edited by this-is-me
Who else would I be?
Link to comment
Share on other sites

http://www.autoitscript.com/forum/index.php?showtopic=12281

You can open a access object without access installed, since I have access installed on every one of my systems, I can't really say about opening macros or such, but I doubt that.

Info on a CD shouldn't be a problem, but the read only thing might be for some things. I personally haven't tried that. Interesting...might have to.

Now as far as speed, I can't quote speed as you give no information on what it is you are really doing with it.

I deal with data in the millions, and some querys can be almost instant, but others can take a few minutes. 10,000 records is tiny though.

It would be easier set up if you had access on one computer to make the database, (import the 9999 records.)

When you set up the 9K file part, make sure to index the fields you want to search, it is the only way to search pretty much.

AutoIt3, the MACGYVER Pocket Knife for computers.

Link to comment
Share on other sites

I would definitely agree that a database is going to be the way to go. I would recommend Access because it is easy and small and the amount of records you have isnt significant, but if you ever see that growing a great deal you may want to consider a more enterprise solution such as MySQL. It comes with a command line utility that you can use to run your SQL queries and such to add/edit/delete data.

I am not quite sure that the CD thing would work, but you could alwasy put it on a server share if you have that setup. (It sounds as though you might) That would keep you from having to circulate around with a CD. Just have a script that runs the required operations everyday.

JS

AutoIt Links

File-String Hash Plugin Updated! 04-02-2008 Plugins have been discontinued. I just found out.

ComputerGetInfo UDF's Updated! 11-23-2006

External Links

Vortex Revolutions Engineer / Inventor (Web, Desktop, and Mobile Applications, Hardware Gizmos, Consulting, and more)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...