I got Windows file with file paths in it. I need to retain only directory structure and remove file names.
Sample data in myfile.txt:
So in myfile.txt I need to search for the last backslash character "\" and remove everything to the end of line, to get:Code:C:\aaa\bbbb\cccc\xxx.txt C:\aaa\bbbb\abc.txt C:\aaa\zzzz.txt <many hundreds of lines with different path depth>
How to remove file names from path?Code:C:\aaa\bbbb\cccc C:\aaa\bbbb C:\aaa