I have the following bad formatted txt file:
id;text;contact_id
1;Reason contact\
\
The client was not satisfied about the quality of the product\
\
;c_102932131
I'm trying to load the file using pyspark by using:
df = sc.read\
.option("delimiter", ";")\
.option("header", "true")\
.option("inferSchema", "true")\
.option("multiLine", "true")\
.option("wholeFile", "true")\
.csv(os.path.join(appconfig.configs[appconfig.ENV]["ROOT_DIR"], "data", "input", file_name))
But the column text is truncated, since the dataframe is:
id|text|contact_id
1|Reason contact|null
null|null|c_102932131
So I lose all the other lines. The goal is to read correctly the file in this way:
id|text|contact_id
1|Reason contact The client was satisfied not about the quality of the product|c_102932131
How can I do this? Thank you