I have a text file (.txt format) as below -

```
|1|NewYork|96|2|Chennai|84|3|Amsterdam|96|

```

I want to read this a data frame using pyspark so that, it is created as below

```
---------------
c0 | c1| c2
---------------
1 | NewYork|96
---------------
2 | Chennai |84
----------------
3 | Amsterdam |96

```

Basically I want to replace every 4th *pipeline*( *|* ) delimiter to *newline character* (*\n*) so that I can create the dataframe.

Can anyone help?