# Percent

## Recommended Posts

"I have a combinations .txt file, where is:

05 07 13 21 29 44

15 16 19 31 35 45

02 03 10 20 24 37

07 18 22 30 40 47

How to make a program that determines the percentage of combinations among.

Example:

\$percent = array(

array(02, 100),

array(03,100),

array(10,100),

array(20,100),

array(24,100),

array(37, 100);

Script is looking to combinations with the highest percentage.

Script find: 02 03 10 20 24 37

Example2:

\$percent = array(

array(02, 100),

array(07,100),

Script find:

05 07 13 21 29 44

02 03 10 20 24 37

07 18 22 30 40 47

I have Big file and sript must have Limit:

Limit: 50 combinations

##### Share on other sites

Question:

Is the line always sorted from small to big numbers?

If so I suggest creating one array entry per line eg \$ArrayOne = "05 07 13 21 29 44"

This will enable you to count the combo's with a loop.

If the file is very very big rather consider using _SQLite . . . . .

And last question is this for a lotto predictor? (You don't have to answer this qiestion)

##### Share on other sites

All: Yes!

AutoItScript is not a good solution?

Question:

Is the line always sorted from small to big numbers?

If so I suggest creating one array entry per line eg \$ArrayOne = "05 07 13 21 29 44"

This will enable you to count the combo's with a loop.

If the file is very very big rather consider using _SQLite . . . . .

And last question is this for a lotto predictor? (You don't have to answer this qiestion)

##### Share on other sites

_SQLite ... is available from AitoIT!

How many lines do you have in your dokument?

Do you have any running Script. Will be easier to help you from there.

##### Share on other sites

Lines: 9821803

Yes, I have PHP script but Allowed memory size of...

_SQLite ... is available from AitoIT!

How many lines do you have in your dokument?

Do you have any running Script. Will be easier to help you from there.

##### Share on other sites

Definitely switch to SQLite to handle this. If you need guidance to help you building and efficient schema, just ask.

Hint: don't simply store lines of draws "as is" (or worse: as 6 columns for each draw), that would be utterly painful to query!

This wonderful site allows debugging and testing regular expressions (many flavors available). An absolute must have in your bookmarks.
RegExp tutorial: enough to get started
PCRE v8.33 regexp documentation latest available release and currently implemented in AutoIt beta.

SQLitespeed is another feature-rich premier SQLite manager (includes import/export). Well worth a try.
SQLite Expert (freeware Personal Edition or payware Pro version) is a very useful SQLite database manager.
An excellent eBook covering almost every aspect of SQLite3: a must-read for anyone doing serious work.
SQL tutorial (covers "generic" SQL, but most of it applies to SQLite as well)
A work-in-progress SQLite3 tutorial. Don't miss other LxyzTHW pages!
SQLite official website with full documentation (may be newer than the SQLite library that comes standard with AutoIt)

## Create an account

Register a new account

• ### Recently Browsing   0 members

×

• Wiki

• Back

• #### Beta

• Git
• FAQ
• Our Picks
×
• Create New...