tommyt11
Member
I have a dilemma. I am quite a novice at parsing text files in vb net. I have tried split to no avail.
This is what I need to do. I have a text file with multiple lines (varies with each run of the function)
The text file is a list of files with paths.
Each path is different i.e.
D:\Folder\subfolder1\subfolder1a\subfolder1b\filename1.ext
D:\Folder\subfolder1\subfolder1a\subfolder1b\subfolder1c\filename2.ext
so forth and so on.
What I am attempting to do is parse just the filenames with their extension and writing to a new text file.i.e.
filename1.ext
filename2.ext
filename3.ext
etcetera
I have seen many different examples of split and regex but none of them seem to go where I am trying to go.
I have tried LastIndexOf can't seem to get it right.
Just need a clue as to what to do code wise I am at a loss.
This is what I need to do. I have a text file with multiple lines (varies with each run of the function)
The text file is a list of files with paths.
Each path is different i.e.
D:\Folder\subfolder1\subfolder1a\subfolder1b\filename1.ext
D:\Folder\subfolder1\subfolder1a\subfolder1b\subfolder1c\filename2.ext
so forth and so on.
What I am attempting to do is parse just the filenames with their extension and writing to a new text file.i.e.
filename1.ext
filename2.ext
filename3.ext
etcetera
I have seen many different examples of split and regex but none of them seem to go where I am trying to go.
I have tried LastIndexOf can't seem to get it right.
Just need a clue as to what to do code wise I am at a loss.