I have read a txt file in pyspark used for a homework with operator "|" separating 3 columns of data. How can I separate these 3 columns in a proper array? This is what I have achieved so far:
+---------------------+
|bid|gender|department|
+---------------------+
| 1|M|Informatics|
| 2|M|Low|
+---------------------+
As you see the header is created but not separated as columns followed by the data.