Pyspark: Split and select part of the string column values
How can I select the characters or file path after the 4th(from left) backslash from the column in a spark DF?
Sample rows of the pyspark column:
\DDevjohnnyDesktopTEST
\DDevmattDesktopTESTNEW
\DDevmattDesktopTESTOLDTEST
\EdevpeterDesktopRUNSUBFOLDERNew
\K924produmsDesktopRUNSUBFOLDERNew
\LE345jskx
fkDesktopRUNSUBFOLDERNew
.
.
.
\ls53f7sn3vsohskmwqsdsfkse
Expected Output
johnnyDesktopTEST
mattDesktopTESTNEW
mattDesktopTESTOLDTEST
peterDesktopRUNSUBFOLDERNew
umsDesktopRUNSUBFOLDERNew
rfkDesktopRUNSUBFOLDERNew
.
.
.
vsohskmwqsdsfkse
My previous question led to this new question. Appreciate any help.
See Question&Answers more detail:os