Reputation: 519
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
Reputation: 13541
Use LineSep option.
df.write.format("csv").option("lineSep", "\r").save(path)
Upvotes: 6