Weighted Values from File List

User Rating: / 0

This generation rule is similar to the Weighted List in that it produces values from a weighted list. But in that case, the generation rule is initialized from a list of files that each contain a subsequence of the weighted (or not weighted) values to generate. If values are weighted then the weight should appear in the first column of each line using a separator in ,;:\t

Weighted List From Files

So, the expected format of the source files is either

<weight1> <separator> <record1>
<weight2> <separator> <record2>
<weight3> <separator> <record3>



For example, consider you have multiple files with a list of cities and their population grouped by state. Those files can be used for multiple purposes, they are reusable from a source data perspectives. For example if you have in those files line such as :

File 1: alabama.csv

2688,Abbeville city
4522,Adamsville city
758,Addison town
356,Akron town

File 2: alaska.csv

31535,Fairbanks city
35,False Pass city 
681,Gambell city

You can generate city names based on population density from multiple such files. The extracted value will be the line without the weight (if source file is tagged as weighted).

Add comment

Security code