Include file contents into LaTeX on the same line

You can declare you own verbatim environment \setverb:

\def\setverb{\def\do##1{\catcode`##1=12}\dospecials }
\def\verbinput#1{\bgroup \setverb \input{#1}\unskip\egroup}

For \verbinput{name.txt}, next text.

\bye

An you must to use ASCII encoded font, no default cmr10 (i is not ASCII encoded unfortunately).


\verbatiminput is implemented using a \trivlist (like an equation) and consists of multiple lines of text.

demo

\documentclass[a4paper]{article}

\usepackage{verbatim}

\begin{document}

\makeatletter
\def\verbatim@font{}
\makeatother

\hrule
\noindent For \parbox{0.8\textwidth}{\verbatiminput{name.txt}}
\hrule

\end{document}