[Tex/LaTex] \includegraphics: number sign # in filename

graphics

I have hundreds of figures with filenames containing "#" to include using \includegraphics, I've tried packages like grffile or currfile, but none of them work. Can anyone suggest a real solution so that I don't need to change hundreds of file names? Thanks.

Update:
1. I'm using Windows.
2. When I compile it, it shows "Illegal parameter number in definition"

Best Answer

You can change the catcode of # before using it:

\documentclass[]{article}
\usepackage{graphicx}


\begin{document}
{\catcode`\#=12 \includegraphics{test#abc}}
\end{document}

But it is really better to avoid such names.