0

I am trying to read a .csv file that has a strange format.

This is what I am doing

df =  spark.read.format('csv').option("header", "true").option("delimiter", ',').load("muyFile.csv"))
df.show(5)

enter image description here

I do not understand why the lonlat entry of the third id is transposed. It seems that the file has two different delimiters. Your help would be much appreciated!

user78910
  • 329
  • 2
  • 12
emax
  • 5,795
  • 11
  • 55
  • 115

1 Answers1

0

your tag field probably contains comma as a value which is treated as the delimiter. enclose your data in quotes or any other quote char(remember to set .option('quote','')) and read the data again. It should work

AnvayHS
  • 1
  • 2