I propose a solution using the csvsimple
package.
\documentclass{article}
\usepackage{csvsimple}
\begin{filecontents}{list.csv}
religion
religious
rely
remain
\end{filecontents}
\begin{document}
\csvloop{
file = {list.csv},
no head,
before reading = {\begin{enumerate}},
after reading = {\end{enumerate}},
before line = \item
}
\end{document}
Edit
In order to draw a line after the elements, use a \rule
:
\documentclass{article}
\usepackage{csvsimple}
\begin{filecontents}{list.csv}
religion
religious
rely
remain
\end{filecontents}
\begin{document}
\csvloop{
file = {list.csv},
no head,
before reading = {\begin{enumerate}},
after reading = {\end{enumerate}},
before line = \item,
after line = \rule{1cm}{.4pt}
}
\end{document}
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.
import random
with open('data.csv', 'r') as input_file:
data = input_file.readlines()
random.shuffle(data)
with open('output_file.csv', 'w') as output_file:
for item in data:
output_file.writelines(item)
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.