from 2D array to .html
in
Programming Questions
•
3 years ago
Hi All,
I'm trying to transform some data stored in a 2d array into an .html (the idea is to print this so other program can read it).
I have a 2d Array with a set of numbers:
- arrayMatrix[i][j] = { {0,1,0,0,0},
- {0,1,0,1,1},
- {0,0,0,0,0},
- {0,0,0,1,0},
- {0,1,0,0,1} };
And I need to print them in an .html ordered like:
I'm changing the numbers into strings and printing with saveString:
- 0,1,0,0,0,
- 0,1,0,1,1,
- 0,0,0,0,0,
- 0,0,0,1,0,
- 0,1,0,0,1
- for (int i = 0; i <= 5; i = i+1) {
- for (int j = 0; j <= 5; j = j+1) {
- arrayMatrix[i][j] = rowData; // << this is clearly wrong...
- textMatrix = Integer.toString(rowData);
- saveStrings("2dMatrix.html", textMatrix);
- }
- }
Clearly is not possible to convert an array into an integer (line 3), neither is possible to print the complete array with saveString... maybe changing the array into a string would do it, but how? and how to cut the rows?? (sorry I don't have a sscce code). Any ideas?
Thanks !!!!
Thanks !!!!
1