Suppose, i having a path and file name in a single line of txt file. below is the example
folder/folder1/folder2/folder3/filename.txt
Now i want to get this whole path so that i can reach to the file. I can get the filename by using awk separated by first '/' reading in reverse order(using NF). But not sure how to get full path.
My output should contain folder/folder1/folder2/folder3