mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Aug 2005
Posts: 14
Eddy2k5 Offline OP
Pikka bird
OP Offline
Pikka bird
Joined: Aug 2005
Posts: 14
well, is it possible to script so it reads a .txt file fast as hell? instead of only $read (file.txt)... coz i got this txt doc with 605000 lines into it. on an 233mhz so its kinda laggy so help me out if its possible.. and i dont want dubblets into the DB, that destroy $ctime ... only thing i ask here is to make $read hella much faster now it can take like 1-2mins to read this Database...

Code;
.------------------------------------------------------------.
[script]
n0=;new [censored] }
n1=on *:TEXT:!addquote *:#fly: {
n2= if ($3 == $null) {
n3= halt
n4= }
n5= else {
n6= set %ech0-check
n7= set %ech0-temp $2 $+ \ $+ *
n8= set %ech0-check $read(predb.txt,w,%ech0-temp)
n9= if (%ech0-check == $null) {
n10= set %ech0-addline $2 $+ \ $+ $ctime
n11= write -il1 file.txt %ech0-addline $3
n12= }
n13=}
`------------------------------------------------------------------ยด

Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
The only thing that will greatly improve the speed of your searches is using a hash table, because the searching mechanism is non lineair, but based on hashing. Any other solution like file handling commands, filter, $read, hidden windows etc. won't cut it, as they use a lineair searching approach.

You must not have doubles you say, because $ctime will screw up? That's fine, as hash table items must be unique, so this will fit your case nicely.

All I need to know now is what your data looks like. Does it have spaces anywhere in the data, or is it like: <word><space><word>. If so, then it'll be possible to create a script easily to transform your text file into a file ready to be loaded into a hash table.

Btw you are using 2 different text files for this. Why? And which one of the two exactly do you want to be faster?

Also you do a check with $read to see if <nickname>\* is in the file, and if it isn't you write to file.txt.
What will happen if it did find a match? Wil it overwrite the entry? Add an entry?

You cant expect people to help you if you keep your queries so vague. Just posting some code doen't cut it, you need to explain exactly where your problem lies, and give as much information as you can.

Btw if your database really has 605000 lines in it, then you shouldn't be using a text file heh, use a real database that you can control with SQL or such.


Gone.
Joined: Aug 2005
Posts: 14
Eddy2k5 Offline OP
Pikka bird
OP Offline
Pikka bird
Joined: Aug 2005
Posts: 14
Eddy-Added-Quote.Im_Fat\$ctime Eddy

Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Are you kidding me with this?

I just asked for you to elaborate much more on your issues, and you reply with 1 line of text? Forget it, I'm not helping you.


Gone.

Link Copied to Clipboard