Dileep Dominic
Dileep Dominic

Reputation: 519

Write csv file with \r in Scala spark

I need to write a csv file in spark with line ending with \r - carriage return. By default lines are ending with \n - newline. Any idea to change this.

Upvotes: 0

Views: 1274

Answers (1)

Lamanus
Lamanus

Reputation: 13541

Use LineSep option.

df.write.format("csv").option("lineSep", "\r").save(path)

Upvotes: 6

Related Questions