I want to export sequence text files. I can Export
a single text file, designating the Directory, however I cannot make it to several files.
I thought if I have data called input
, I can get 6 text files in the current directory, such as "C:\testfolder\new1.txt", "C:\testfolder\new2.txt", ..., "C:\testfolder\new6.txt".
However {$Failed, $Failed, $Failed, $Failed, $Failed, $Failed}
is returned.
If someone knows how to do this, please tell me.
input = {{{6, 7, 9, 1, 5, 5, 7, 3, 7, 4}, {2, 7, 3, 2, 0, 10, 1, 0, 4,
3}, {0, 0, 4, 10, 0, 8, 7, 2, 2, 5}, {6, 1, 5, 10, 3, 1, 3, 10,
5, 7}}, {{6, 10, 6, 0, 0, 0, 2, 1, 0, 6}, {4, 2, 6, 5, 1, 8, 9,
7, 3, 9}, {4, 5, 8, 0, 9, 5, 4, 8, 9, 6}, {1, 0, 1, 2, 3, 7, 3,
4, 2, 3}}, {{4, 6, 9, 10, 3, 3, 0, 1, 7, 6}, {3, 2, 10, 8, 3, 2,
3, 6, 2, 2}, {10, 0, 3, 7, 1, 1, 3, 10, 5, 4}, {4, 7, 3, 2, 2, 4,
9, 4, 3, 0}}, {{8, 9, 0, 10, 1, 7, 2, 10, 4, 0}, {9, 10, 4, 9,
4, 10, 0, 2, 5, 8}, {4, 6, 4, 10, 0, 7, 0, 0, 0, 5}, {8, 1, 1, 2,
2, 1, 5, 7, 2, 8}}, {{0, 1, 1, 0, 0, 0, 0, 1, 0, 1}, {1, 0, 0,
1, 1, 1, 0, 0, 1, 0}, {1, 1, 1, 0, 1, 0, 1, 0, 1, 0}, {0, 1, 0,
1, 1, 1, 1, 0, 1, 0}}, {{13, 4, 3, 6, 8, 19, 7, 3, 4, 12}, {6, 9,
1, 9, 13, 11, 3, 11, 8, 2}, {12, 9, 4, 18, 14, 3, 8, 9, 12,
1}, {8, 11, 4, 3, 15, 0, 11, 7, 18, 2}}};
st = StringJoin["C:\\testfolder\\new", ToString[#], ".txt"] & /@
stringform = ToString[TextString[#] // InputForm] & /@ st
Export[stringform[[#]], input[[#]], "Table"] & /@ Range[Length[st]]
st = StringJoin["C:\\testfolder\\new", ToString[#], ".txt"] & /@
obviously makes no sense. Do you mis-copy the code sample? $\endgroup$