I have used excel reader > table row to variable > variable expression to configure a path. As the file could be in “.xls” or “.xlsx” format. I would like to know how to put wildcard .xls in the variable expression node so that both file format could be picked up
I’m not sure exactly what expression you would need, because I’m not sure what you would like to do with the evaluation (i.e. would you like a true/false variable depending on if there is .xls(x) or something else), but in order to check if “.xls” is contained, you can use: contains(variable("main_file_path"),".xls")
If you want to check that the .xls(x) is contained strictly at the end of the string, I would use Regex: regexMatcher(variable("main_file_path"),".*\.xlsx?")
Hope this helps, let me know if not! Cheers,
Karen
Sometimes the file format i want to extract following the path is in “.xls” format but sometimes it is in “.xlsx”, so i would like to have at least “.xls” in the path (maybe using a wildcard) to ensure that file in both “.xls” and “.xlsx” could be read.
I have found the solution for this, to use file filter options in excel reader node and insert wildcards there. For example, i have file YYMM_draft_for_YYMM in “.xls” and “.xlsx”, this wildcard could help to detect the file in both formats