I have a list of about 30,000 files (with paths) that need to be individually copied along with their folder structures. Unfortunately, the paths are very long and the file copy utilities that will handle this function require that I specify destination folders for each file, which means I need to remove the file name from each of the 30,000 lines, leaving the folder structure intact.
What I need to do is find a way through a regular expression replace in Notepad++ that will delete all of the data on each line of the document after the last backslash "\" on the line.
C:\Data\ToCopy\file1.txt C:\Data\ToCopy\Folder1\file2.txt C:\Data\ToCopy\Folder2\file3.txt C:\Data\ToCopy\Folder2\Subfolder1\file4.txt
C:\Data\ToCopy C:\Data\ToCopy\Folder1 C:\Data\ToCopy\Folder2 C:\Data\ToCopy\Folder2\Subfolder1
Any ideas on how to format the expression to allow this? I've tried
[^"\"]+$, but that appears to be invalid.