So I have a word list file in .txt
format,
I want to edit it and enumerate them. But since the file runs into thousands of lines potentially, it would be a daunting task to do it manually. I wonder if it is possible to automatically enumerate all the words (and make other small repetitive changes to each word) and even better, randomize them.
N.B. I am not exactly sure if it is a task that can or should be done in LaTeX, so if not, I also welcome an alternative suggestion. Thanks in advance.
Edit: When I meant small repetitive change, I have in mind something like drawing a ____ after each word.
So essentially, I need LaTex to do three things:
- read the file and itemize it
- draw a line after every word
- randomize the whole list.
Sorry, I should have formated my questions better.
Best Answer
I propose a solution using the
csvsimple
package.Edit
In order to draw a line after the elements, use a
\rule
:As LaTeX does not store the individual items of an enumerate, it's tricky to shuffle the items. There are some heavy solutions to this problem, but I wouldn't recommend any of them when handling large datasets ("thousands of lines potentially"). Just quickly set up a Python script to shuffle your list around before compiling your document.
You could even have a look at the
pythontex
package which enables you to add executable Python code to your LaTeX file. Upon document generation, the code will be executed and the results are added to the LaTeX file. I could imagine, that this would allow you to implement the shuffling to the document generation.