Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

An empty row is added to the end of the file #115

Open
moofatech opened this issue Nov 6, 2017 · 0 comments
Open

An empty row is added to the end of the file #115

moofatech opened this issue Nov 6, 2017 · 0 comments

Comments

@moofatech
Copy link

Currently when writing to a new file, I can see an extra empty row is added to the end of the file when viewing in a text editor.

Here is the piece of code I tried :
def test()
{
val csvOutFile = new File(s"$OUTPUT_DIRECTORY/test.csv")
val csvWriter = CSVWriter.open(csvOutFile)

  //write headers
  csvWriter.writeRow(List("Col1", "Col2", "Col3"))
  
  //write rows
  for(row <- 1 to 5)
    csvWriter.writeRow(List(row, "data1",  "data2"))
    
  csvWriter.close()      
}

and attached the resulting csv
test.csv.zip

Additional Info:
OS: Ubuntu 16.04 with LibreOffice installed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant