Hello!
I'm new to Python,so I'm sorry if it's a simple question.
I have a text file where each line contains a path.Under some of the "final" subdirectories there are 1 or 2 lines that contain some values.The text file looks like this:
folder1
folder1\folder2
folder1\folder2\folder3
'something1','something2'
folder4
folder4\folder5
folder4\folder5\folder6
'something3','something4'
'something5','something6'
folder4\folder5\folder7
folder4\folder5\folder7\folder8
folder5
etc
I would really appreciate some help on writing a script that will keep only the "final" subdirectories and the values in the file(or write them to a new text file).Something like this:
folder1\folder2\folder3
'something1','something2'
folder4\folder5\folder6
'something3','something4'
'something5','something6'
folder4\folder5\folder7\folder8
etc
Thank you in advance!