Code: Select all
\newcommand{\readme}[2]{%
\input{['file', #1, '_', #2, '.dat']}
}
Code: Select all
\newcommand{\readme}[2]{%
\input{['file', #1, '_', #2, '.dat']}
}
Code: Select all
\newcommand\reame[2]{%
\input{#1_#2.dat}%
}
Just out curiosity, what if you had the actual string '#1' as a file name? For example, my file would actually be named file#1.datjosephwright wrote:(I'm assuming you've dealt properly with the filenames here: underscores tend to be bad news!)Code: Select all
\newcommand\reame[2]{% \input{#1_#2.dat}% }
Code: Select all
\edef\x{file\string#1.dat}
\input{\x}