Advertisement
UF6

CSV File Reader

UF6
Nov 14th, 2023
660
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.50 KB | Source Code | 0 0
  1. import csv
  2.  
  3. def read_csv_file(file_path):
  4.     try:
  5.         with open(file_path, 'r', newline='') as file:
  6.             reader = csv.reader(file)
  7.             for row in reader:
  8.                 print(row)  # Modify this to suit your specific needs (e.g., process or manipulate the data)
  9.     except FileNotFoundError:
  10.         print("File not found. Please provide a valid file path.")
  11.  
  12. # Replace 'file_path.csv' with the path to your CSV file
  13. file_path = 'B5 segmentSummary (1).csv'
  14. read_csv_file(file_path)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement