I am using openpyxl module, but now it turns out that it doesnot support csv format. So, How can I differentiate whether the file incoming is .xlsx or .csv format
Load it in try:..except:.. At least in case of xlsx you can be quite confident that if it's failing, then it's not xlsx. CSV is so primitive a format, that almost everything can be treated as such, but I think that's the maximum that you can squeeze out of it.
How to check if the browsed file is .xlsx or .csv?