I have a small problem. I am working on a probability solution.

I have quasi-randomly generated data sets, from the value of 1 to 999. These values are the end result of another mathematical process.

The data comes out in groups of seven, eight and ten.

We have a mid range of 501-550.

If I could get help on the seven group problem, Im sure I could find my way with the other two groups when I can see the code structure.

I need to build a database (which could be a text file if it is big enough) of all possible value combinations, so out of the 50 numbers, from 501 to 550.

So the first possible combination would be

501,502,503,504,505,506,507

Then the next possible combination would be

501,502,503,504,505,506,508

And the combinations would tick up one at a time until

544,545,546,547,548,549,550, which would be the final one.

I expect about 10 million results.

I need each individual result output to a text file / word pad one line at a time, delineated by a comma.

Could you tell me perl code which would do this ?

Thankyou very much

I have quasi-randomly generated data sets, from the value of 1 to 999. These values are the end result of another mathematical process.

The data comes out in groups of seven, eight and ten.

We have a mid range of 501-550.

If I could get help on the seven group problem, Im sure I could find my way with the other two groups when I can see the code structure.

I need to build a database (which could be a text file if it is big enough) of all possible value combinations, so out of the 50 numbers, from 501 to 550.

So the first possible combination would be

501,502,503,504,505,506,50

Then the next possible combination would be

501,502,503,504,505,506,50

And the combinations would tick up one at a time until

544,545,546,547,548,549,55

I expect about 10 million results.

I need each individual result output to a text file / word pad one line at a time, delineated by a comma.

Could you tell me perl code which would do this ?

Thankyou very much

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.

For either my solution or Adam's, just redirect the output to a text file using the greater than symbol:

scriptname.pl > filename.txt

Open in new window