I would like to go through this file:
\chapter{CHAPTER}
TEXT
\e
h454
\e
\e
454
\e
\begin{figure}
\NOTE{figure}
\centering
\includegraphics[width=0.49\textwidth]{f.pdf}
\caption{\NOTEB{The concept}}
\label{fig}
\end{figure}
SOME TEXT
\e
454
\e
SOME TEXT
\begin{figure}
\NOTE{figure}
\centering
\includegraphics[width=0.49\textwidth]{f.pdf}
\caption{\NOTEB{The concept}}
\label{fig}
\end{figure}
\chapter{CHAPTER}
SOME TEXT
and print some parts:
awk '/\\begin\{figure\}/,/\\end\{figure\}/' file.tex
awk '/\\e/,/\\e/' file.tex
awk '/\chapter/' file.tex
but all into one file and in the order as in the input file. So, the desired output is (empty line does't matter):
\chapter{CHAPTER}
\e
h454
\e
\e
454
\e
\begin{figure}
\NOTE{figure}
\centering
\includegraphics[width=0.49\textwidth]{f.pdf}
\caption{\NOTEB{The concept}}
\label{fig}
\end{figure}
\e
454
\e
\begin{figure}
\NOTE{figure}
\centering
\includegraphics[width=0.49\textwidth]{f.pdf}
\caption{\NOTEB{The concept}}
\label{fig}
\end{figure}
\chapter{CHAPTER}
How to connect these commands and make it to follow the order of input file?