I have a project where I need to populate an existing SharePoint library with reports each day from a file share. The new report will overwrite existing reports (but not folder) and be put into folders, based on part of the report filename.
- Filename of report will be alphanumeric (ex. Report_Location_City_01.00, or Report_Location_City_3287.00)
- Check to see if folder exists in SP document library, create if it doesn't exist.
- Folder name will be based on report filename. Report name needs to be stripped down to just numeric, removing leading zeros and anything after decimal. Using example above, folders would be named "1" and "3287".
- There is always an underscore before numeric.
- Numeric is always at end of name.
- The reports are not always sequential numbers.
- The report name may or may not have leading zeros in numeric portion.
- Cannot overwrite folders, but ok to overwrite report if it exists in folder
I have tried to approach this a couple different ways, but am not getting the results I need. Any ideas are appreciated.