 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Homer
Joined: 12 Jan 2006 Posts: 62 Location: Dallas, Texas
|
Posted: Fri Mar 10, 2006 2:51 am Post subject: Dynamic Record Generation |
|
|
I'm looking for a general solution approach...
The problem statement: How do you dynamically generate 1,000's of records based on a series of ranges?
Further clarfication: I need to create a bunch of records that will get imported into an application for processing. The application is software that we sell and the records would be used to validate a demo scenario. The records are made up of a set of variables. The number and type of variables will change over time, let's say for the next demo. For argument's sake, let's say these are banking transactions and each record is made up of variables that would denote banking product based transaction. (Part of this design challange is creating a general framework that could be reused. The next demo might call for a larger number of variables.)
EX Record: EmployeeID, LoanType, LoanAmount, LoanDate, TransactionType
The guidance I'm looking for comes in here. How would you dynamically create 1000 records based on a range of EmployeeID's, LoanTypes, LoanAmounts, Dates, and TransactionTypes?
I could see having a collection of files, one each for the different data variables in the record; Employees.txt, LoanTypes.txt, TransactionTypes.txt. The remaining variables could be managed just with dynamic number generation and a defined range. (The demo scenario might just be looking at a specific quarter and the dollar amounts might have to fall within a reasonable range, 1,500 to 5,500 dollars. The tricky part, pre counting the number of elements in each file in order to acurately feed the random number generator.
Any suggestions or ideas would be great...
Homer |
|
| Back to top |
|
 |
Marge Simpson Guest
|
Posted: Fri Mar 10, 2006 5:01 am Post subject: |
|
|
I would qualify this request to be moved to the "Ask for Help" Section, Homer! Seriously.  |
|
| Back to top |
|
 |
PhiLho
Joined: 27 Dec 2005 Posts: 6721 Location: France (near Paris)
|
Posted: Fri Mar 10, 2006 8:55 am Post subject: |
|
|
antonyb provided a very nice solution for such problem: given a large number of items (files in a directory, lines in a file, whatever), how to randomly choose one item without having to read all items? Of course, the random choice must be fair (same probability for all items).
This will answer at least one of your questions...
Note: you can use AutoHotkey for this task, but for speed or convenience reasons (at least better array handling), you may want to choose another language.
Of course, if you stick to AHK, we are here to provide more help. _________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2") |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|