Creating FSA Sample Data
Created: 17 Jan 2013 | Updated: 18 Jan 2013
The other day I need something to create some data for FSA testing. After some surfing, and trying a number of different scripts, I amalgamated a bunch and came up with the attached.
There are two files, both will need Python 3+ installing. That's available from here: http://www.python.org/download/. It's because it uses 'collections'.
Both also need a word list file. I used the file 12dicts-5.0.zip from: http://wordlist.sourceforge.net/
Notes for large.py
* This will create a single 'large' file.
* Edit the file as required, for example:
SizeOfFile = 200 #Mb << The size of the file
words = open("5desk.txt", "r").read().replace("\n", '').split() << the name of the word list
fname = "bigfile.txt" << The name of the file to create
Notes for create.py
* This will create a LOT of files, of the same size.
* Edit the file as required, for example:
NumberOfFiles = 200 << Number of files
path = r"c:\temp\fs-random\beta" << Place to create the files - it has to exist
words = open("5desk.txt", "r").read().replace("\n", '').split() << the name of the word list
size = 1048576 # 1Mb << Roughly the size of each file
fname = path + "\\" + "test_" + str(messagecount) + ".txt" << the name given to each file
Download Filed Under: