I'd set up an interface for the job.
The main command is \loadprojects that takes as arguments the first project number and the last one (missing numbers will not be a problem).
With \highlightprojects you state which ones you want highlighted (here you specify the precise termination).
If you do \loadprojects* then all projects are considered highlighted and \sethighlights is ignored.
You can specify the format of the numbers with the optional argument (default 2); so
\loadprojects[3]{0}{3}
would try and load the projects numbered 000, 001, 002 and 003.
In the example below I do \loadprojects with different settings of \sethighlights. First a couple of them are highlighted, then none, then all of them.
The available files are ramona00.tex, ramona01.tex, ramona02.tex, ramona03.tex and ramona05.tex (number 04 is missing).
\documentclass{article}
\usepackage[a6paper]{geometry} % to make smaller pictures
\usepackage{fancyhdr}
\fancyhf{}
\fancyhead[R]{\projecttype}
\fancyfoot[C]{\thepage}
\pagestyle{fancy}
\ExplSyntaxOn
\NewDocumentCommand{\sethighlights}{m}
{
\seq_gset_from_clist:Nn \g_ramona_project_highlights_seq { #1 }
}
\NewDocumentCommand{\setprojectroot}{m}
{
\tl_gset:Nn \g_ramona_project_root_tl { #1 }
}
\NewDocumentCommand{\loadprojects}{sO{2}mm}
{% #1 = * for all highlighted,
% #2 = number of digits,
% #3 = start point,
% #4 = end point
\ramona_project_load:nnnn { #1 } { #2 } { #3 } { #4 }
}
\NewDocumentCommand{\projecttype}{}
{
\tl_use:N \l_ramona_project_header_tl
}
\bool_new:N \g_ramona_project_all_highlighted_bool
\tl_new:N \g_ramona_project_root_tl
\tl_new:N \l_ramona_project_header_tl
\seq_new:N \g_ramona_project_highlights_seq
\cs_new_protected:Nn \ramona_project_load:nnnn
{
% if all projects are highlighted or none is, set the conditional to true
\bool_lazy_or:nnT
{ \bool_if_p:n { #1 } } % all highlighted
{ \seq_if_empty_p:N \g_ramona_project_highlights_seq } % none highlighted
{
\bool_gset_true:N \g_ramona_project_all_highlighted_bool
}
% now input the files
\int_step_inline:nnn { #3 } { #4 }
{
\clearpage
\bool_if:NTF \g_ramona_project_all_highlighted_bool
{% all or no projects are highlighted
\tl_set:Nn \l_ramona_project_header_tl { Projects }
}
{% check whether the current project is highlighted
\seq_if_in:NxTF \g_ramona_project_highlights_seq
{ __ramona_projects_pad:nn { #2 } { ##1 } } % the current item
{% the project is highlighted
\tl_set:Nn \l_ramona_project_header_tl { Highlighted~Projects }
}
{% the project is not highlighted
\tl_set:Nn \l_ramona_project_header_tl { Other~Projects }
}
}
\file_if_exist_input:n { \g_ramona_project_root_tl __ramona_projects_pad:nn { #2 } { ##1 } }
}
}
\cs_new:Nn __ramona_projects_pad:nn
{
\prg_replicate:nn { #1 - \tl_count:n { #2 } } { 0 } #2
}
\ExplSyntaxOff
\setprojectroot{./ramona}
\begin{document}
\thispagestyle{empty}
\begin{center}
Only some are highlighted
\end{center}
\sethighlights{00,02}
\loadprojects{0}{5}
\clearpage
\thispagestyle{empty}
\begin{center}
None highlighted
\end{center}
\sethighlights{}
\loadprojects{0}{5}
\clearpage
\thispagestyle{empty}
\begin{center}
All are highlighted
\end{center}
\loadprojects*{0}{5}
\end{document}
Some are highlighted

None is highlighted

All are highlighted
