Currently, FileGetExt returns the file extension including the Excel sheet name if present, e.g.,
FileGetExt("filename.xlsx|||`Sheetname$`")returns ".xlsx|||`Sheetname$`".
In many cases, the pure file extension is needed, and removing the sheet name is not always trivial (because it is sometimes separated by "|", sometimes by "|||").
Proposal:
- Extend FileGetExt by an additional optional parameter "OmitSheet".
- Add a new command FileGetSheet with optional parameter "CleanUpSheet".
FileGetExt("filename.xlsx|||`Sheetname$`") → ".xlsx|||`Sheetname$`"
FileGetExt("filename.xlsx|||`Sheetname$`", 0) → ".xlsx|||`Sheetname$`"
FileGetExt("filename.xlsx|||`Sheetname$`", 1) → ".xlsx"
FileGetSheet("filename.xlsx|||`Sheetname$`") → "`Sheetname$`"
FileGetSheet("filename.xlsx|||`Sheetname$`", 0) → "`Sheetname$`"
FileGetSheet("filename.xlsx|||`Sheetname$`", 1) → "Sheetname"
FileGetSheet("filename.yxdb) → "" or Null()This way, the default behaviour would be unchanged to preserve backwards compatibility.
The extension and new command would make handling of Excel filenames much easier.