I am trying to split a string on multiple lines of a csv into three substrings, which I need to remain on the same line while also adding single quotation marks on sub-string 2 and 3 on the line followed by a comma.
The lines in the csv be in the following format:
12345678/ABCDE.pdf
12345678/ABCDE.pdf
12345678/ABCDE.pdf
As I am new to Python, I have tried a split on the lines which returns the first two sub-strings without the / but I am not sure how to obtain the final desired output.
'12345678', 'ABCDE.pdf'
I would like the output to look like the below
12345678,'/ABCDE.pdf','ABCDE',
12345678,'/ABCDE.pdf','ABCDE',
12345678,'/ABCDE.pdf','ABCDE',
with the final string containing the title of the pdf without the file extension.
Any help would be greatly appreciated.