I have been looking everywhere and I found the ways of doing this with images with \usepackage{float} for \includegraphics. But I also have texts from .txt files that I have as in \lstinputlisting that I would also like to force.
I don't really understand the documentation of how placement works.
5.1 Space and placement
float=[*] <subset of tbphi> or
floatfloatplacement
makes sense on individual displayed listings only and lets them float. The argument controls where LATEX is allowed to put the float: at the top or bottom of the current/next page, on a separate page, or here where the listing is. The optional star can be used to get a double-column float in a two-column documentfloatplacement=<place specifiers> tbp
is used as place specifier if float is used without value.
Any ideas how I force the code below with \lstinputlisting?
\lstinputlisting[float=h,frame=tb,
caption=Iteration: 2. Variable importance for unpruned decision tree ,captionpos=b, belowcaptionskip=2cm ,label=zebra]{results/maybe_80_20.txt}




Hspecifier for figures. Why don't you use it for listings? But please consider that you really disable all of the advantages and the concept of floats. – TeXnician May 10 '17 at 04:23\lstinputlisting[float=H,…will not work. See my note about this in my answer below. – Schweinebacke May 10 '17 at 06:30