My problem statement is to find if the imported file is a CSV
or EXCEL
file in pandas. The input will be given from the command line as sys.argv[1] where sys.argv[1] is 'D:/Users/abc'
When the path along with file name is given in command line as a parameter, I have to check inside my script if sys.argv[1] is a CSV or EXCEL file
eg: python myscript.py D:/Users/abc [abc is the file name]
This should say if the file is CSV or EXCEL
I tried referring the answers from below link, but could not find exactly what I am looking for!
How to check the uploaded file is csv or xls in python?
Any help would be highly appreciated