[Tex/LaTex] import table entries from text file

importinputlongtabletables

I'm trying to do something like this:

\begin{longtable}{| c | l |}
\hline \textbf{Short name }& \textbf{Description} \\
%assume all lines in the text are '\hline <name> & description \\'
\input{logs/some_entries.txt}
\input{logs/other_entries.txt}
%[...]
\hline
\end{longtable}

Where the text files are bash-generated.

If I copy-paste the input of the text files, the pdf is built correctly. Trying to use the files like this, though, will result in

! Misplaced \noalign.\hline ->\noalign{\ifnum 0=`}\fi \penalty \@M \futurelet \@let@token \LT@@h... \hline

How do I make this work?

EDIT

Minimal "working" example:

\documentclass[11pt]{article}
\usepackage[a4paper, portrait, margin=1in]{geometry}
\usepackage{hyperref}
\usepackage{color, colortbl}

\usepackage{longtable}

\begin{document}

\begin{longtable}{| c | l |}
\hline \textbf{Short name }& \textbf{Location} \\
\hline Google & \url{https://google.com} \\ 
\input{some_entries.txt}
\hline
\end{longtable} 

\end{document}

where some_entries.txt contains

\hline TEX & \url{http://tex.stackexchange.com}\\%

Best Answer

This works for me:

...
\makeatletter %must be!
\newcommand ...
\makeatother % must be!
\begin{document}
...
\begin{longtable}{| c | l |} \hline
\textbf{Short name }& \textbf{Description} \\
%assume all lines in the text are '\hline <name> & description \\'
\ExpandableInput{test01.txt}
\ExpandableInput{test02.txt}
...
\hline
\end{longtable}

test01.txt:

\hline name & description \\
\hline myname & mydescription \\

test02.txt:

\hline name2 & description2 \\
\hline name3 & description3 \\
Related Question