A proof of concept, as details are missing from the question. The \tarassinput command inputs the file only if the first line agrees with the second argument.
\begin{filecontents*}{typea.tex}
% type A
here latex stuff
\end{filecontents*}
\begin{filecontents*}{typeb.tex}
% type B
here latex stuff
\end{filecontents*}
\documentclass{article}
\makeatletter
\newread\tarass@read
\newcommand{\tarassinput}[2]{%
% #1 is the name of the file, #2 is the first line
\openin\tarass@read=#1\relax
\begingroup\catcode`\%=12
\edef\tarass@tempa{\@percentchar\space#2\space}%
\read\tarass@read to\tarass@tempb
\closein\tarass@read
\ifx\tarass@tempa\tarass@tempb
\expandafter\@firstoftwo
\else
\expandafter\@secondoftwo
\fi
{\endgroup\input{#1}}%
{\endgroup}%
}
\makeatother
\begin{document}
Yes: \tarassinput{typea}{type A}
No: \tarassinput{typeb}{type A}
\end{document}

Now that more information is available, here's a possibility with l3regex:
\begin{filecontents*}{typea.tex}
here latex stuff
\end{filecontents*}
\begin{filecontents*}{typeb.tex}
\begin{minipage}{5cm}
here latex stuff
\end{minipage}
\end{filecontents*}
\documentclass{article}
\usepackage{xparse,l3regex}
\ExplSyntaxOn
\NewDocumentCommand{\tarassinput}{m}
{
\tl_set_from_file:Nnn \l_tarass_input_tl { } { #1 }
% \A matches the start
% \c{begin} matches \begin
% \cB. matches any "group begin" token
% \cE. matches any "group end" token
\regex_match:nVF { \A \c{begin} \cB. minipage \cE. } \l_tarass_input_tl { \item }
\tl_use:N \l_tarass_input_tl
}
\cs_generate_variant:Nn \regex_match:nnF { nV }
\ExplSyntaxOff
\begin{document}
\begin{itemize}
\item Start
\tarassinput{typea}
\tarassinput{typeb}
\end{itemize}
\end{document}

\typeAand\typeB, not comments. – David Carlisle Apr 14 '16 at 20:48\begin{minipageor not. – Tarass Apr 14 '16 at 20:55