I have a tar file whose name I am successfully able to read and store in a variable,
tarname = 'esarchive--Mona-AB-Test226-8037affd-06d1-4c61-a91f-816ec9cb825f-05222017-4.tar' But how do I extract just "Mona" from this file name and store it in a variable?
(The filename structure for the tar file will be same as above for all tar files with the name occuring after "es-archive--{Name}-AB" , so a solution which returns any name obeying this format)
Thanks!
tarname.split('-')[2].