When writing a column name into a CSV file through java the space between two words in a column comes up as double quotation marks...
eg. test_data[0][36] = "True Accept"; displays as True" Accept in the csv file..
Any ideas how this can be fixed?
Here is the code:
private void writeToCSV() throws IOException {
CSVWriter writer = new CSVWriter(new FileWriter("list_of_churners.csv"),',',' ');
String [] data = new String[40];
for(int i=0;i<341;i++)
{
for(int k=0;k<40;k++)
{
data[k] = test_data[i][k];
}
writer.writeNext(data);
}
writer.close()
}
EDIT: Here is the solution:
CSVWriter writer = new CSVWriter(new FileWriter("list_of_churners.csv"),',','\t ');
Changing space ' ' to '\t' fixes the problem.