Assuming your table is called something like myTable
:
fortranTable = Flatten[Table[
"STRING_" <> ToString[i] <> ToString[j] <> ToString[k] <> " = " <>
ToString[myTable[[i, j, k]] // FortranForm],
{i, Dimensions[myTable][[1]]},
{j, Dimensions[myTable][[2]]},
{k, Dimensions[myTable][[3]]}]]
<>
is the concatenation operator for strings, so I'm just converting the indices to strings and then joining them together. I have an expression like x^26 in position 111, I get: STRING_111 = x**26
.
EDIT:
If you want to export the final table, the following works but tweaks can be made depending on exactly what you want the output to look like.
Export["filelocation/filename.txt", fortranTable]
I believe you can use either double backslashes \\
to separate the parts of file names or a single slash, and of course filelocation
and filename
should be changed to suit your needs, but the quotation marks are required. This should give you a file where each entry in the table has its own line (that is, they're separated by '\n').