I want to read a underscore character from a file with \readline and print it as an underscore in the resulting pdf. But the result is a high point. I've read quite a lot about category/character codes but it is still quite confusing.
I've found this related question: \chardef and underscore, but I would prefer not changing the font.
Here the minimal working example:
\documentclass[12pt]{article}
\usepackage{xstring}
\usepackage{filecontents}
\begin{filecontents*}{data.txt}
_
\end{filecontents*}
\begin{document}
\newread\myread
\openin\myread=data.txt
\readline\myread to\line
\StrLeft{\line}{1}[\firstletter]
The content of firstletter should be printed here: \firstletter
But it should be displayed as: \_
\end{document}

