The first command strips down the full path filename to the filename only ising the basename command.
filename=$(basename $filenamefullpath)
Afterwards you can see how to extract the file extension from the filename. There is no need to do this after issuing the above command since this command will just remove everything after the first from right dot (‘.’) — so make sure that the filename you are parsing has a dot or you will end up with wrong results (like the full path or a part of the full path if it contains a dot somewhere).
extension=${filename##*.}
Finally, by issuing the following command you remove everything after the first dot on the right (including).
The following commands will allow you extract various information from the full path of a file. Part of the information is the filename, the file extension, the file base and the directory it is located in. # Truncate the longest match of */ from the beginning of the string filename="${fullpath##*/}";…
Get workbook full path with filename =LEFT(CELL("filename"),FIND("#",CELL("filename"))-1) Explanation If you want to get the workbook filename and path, you can do so with a formula that uses the LEFT and the FIND function. The CELL("filename") function is used to get the full file name and path along with current sheet…
The following commands will search in the .tar archives found in the specified folder and print on screen all files that their paths or filenames match our search token. We provide multiple solutions, each one for a different type of .tar archive depending on the compression used. For .tar archives…