Is there any way to change the caption of a table after its declaration?

I have some tables that are generated automatically by a third-party program. I would like to change their captions without editing their text. Is there any way to change the caption of a table after it has been declared? For example:

\input{file_containing_the_table}
\some_command_to_change_the_caption{new_caption}


where file_containing_the_table.tex is something like this:

\begin{table}
a tabular ...
\caption{old_caption}
\label{table_label}
\end{table}


Thanks.

{

This code locally redefines \caption to discard its argument and instead use the original caption command with your new text.