count is a simple program: it takes text files as input and counts how many times each lines appears.
A couple of years ago, I made a video:
count.py uses a Python dictionary to count items, but that requires a lot of memory to process gigabytes of data.
This new version helps with this problem by providing a count method using a database (sqlite3). By default, a dictionary is still used. But counting with a database can be selected with option -c. With option -c you can provide the name of the database to use: if the name is :memory:, the database will be created in memory. Counting with a sqlite3 database in memory requires less memory than counting with a Python dictionary, but is slower. If the name is a filename, the database will be created on disk. This is of course way slower than in memory, but can process even larger files.
count_v0_2_0.zip (https)
MD5: ACF1982045ABEF86FCDBA87A84F5F588
SHA256: 373DDA0B2C176624998B5907261477943F677855CCECCDD42D6BEB758F8E7B79
Article Link: https://blog.didierstevens.com/2017/07/27/update-count-py-version-0-2-0/