To check if the given file is .csv or .xlsx/.xls and open it based on that

Hey! may be this topic could help you. File extension recognition:
You could use Path.GetExtention(item) =“.xlsx” or Path.GetExtention(item) =“.csv” within a if condition. If true then open it.

1 Like