CSV data is very widely used in the cyber security and data science domain, whether in the form of log files, as an output of Nessus or Qualys reports (in Excel format), or large datasets for machine learning. Python provides excellent support for CSV files with the built-in CSV module. In this section, we shall explore this module and look at the pandas Python utility with a focus on CSV.
Let's first look at the built-in CSV module offered by Python. The following code snippet, called csv_parser.py, demonstrates this module:
The preceding code helps us understand how we can use the CSV module to read CSV files in Python. It's always ...