I just need help exporting array elements to a csv file. I don't know what's wrong with my code. Any help is gladly appreciated. Thanks.
for (int index = 0; index < cols.length; index++)
{
FileWriter fw = new FileWriter(newFileName);
if (index == cols.length - 1)
{
fw.append(cols[index]);
}
else
{
fw.append(cols[index]);
fw.append(",");
}
}
When I run this. Nothing happens to my csv file. Infact, it wipes everything of. Please help.