Python script to read first line of csv files and get the total amount of lines in the file.
Have a large file that you need to view the headers? This simple script reads the headers without opening the file in notepad or Excel. Use this if you have a large csv that needs it's headers examined.
This script works with Python 3.X.
####Running the Script
- Open your favorite IDE or Notepad and provide the path to your CSV in the filename variable.
- Save the file
- Run the Read-Headers-CSV-python.py script by doing one of the following:
- Run in the IDE.
- Double Click in Windows Explorer.
- Run by navigating to the folder in the command line.
####Output The output of the script will be the names of the headers in the csv file as well as the number of lines including the headers
['These', 'Are' , 'Sample', 'Headers']
10 Total lines and headers
Press any key to continue...