I am trying to save an integer matrix to the csv file. My code is listed as follows.
try
{
FileWriter writer = new FileWriter("test.csv");
for(int i = 0; i < row; i++)
{
for (int j=0; j<(column-1); j++)
{
writer.append(Matrix[i][j]);
writer.append(',');
}
writer.append(Matrix[i][j]);
writer.append('\n');
writer.flush();
}
writer.close();
}
catch(Exception e)
{
e.printStackTrace();
}
However, the Eclipse gives the following error message:
method append(CharSequence) in the type Writer is not
applicable for the arguments (int)
Please let me know how to fix this issue. Thanks.