I have a file path.txt with the path to a file(say a txt file):/Folder/F1/F2/F3/F4/.../Fn/abc.txtI want to extract the path i.e the string from beginning to the last occurrence of / (since the number of folder in path may vary).I want to get:/Folder/F1/F2/F3/F4/.../FnWhich would be the best choice: sed/awk/perl/vi and how?
How to extract string between Nth and Mth occurrences of a pattern?
text processing