Just let’s sort it out one by one
as mentioned in the beginning:
- Input: A FullFilePath - needed output: the FolderName containing the file
\xxx\Client\Ireland\Dublin\Policies\AAA\Joe Bloggs\Policy\Text.pdf - Policy
then as mentioned use the FullFilePath and take the FolderName from the Folder containing this File
So, Implementation is as given above
But let’s not mixed up FullFolderPaths and FullFilePath
Kindly note: Any Logics like the file is detectable on pattern name Dot Extension are not valid:
as we are looking for files with GetFiles then IAmAFolder.xlsx is not part of the retrieval