import os
import csv
def get_file_path(filename):
currentdirpath = os.getcwd()
file_path = os.path.join(os.getcwd(), filename)
print(file_path)
return(file_path)
path = get_file_path('Invoice-Item.csv')
def read_csv(filepath):
with open(filepath, 'r') as csvfile:
reader = csv.reader(csvfile)
for i in range(0, 9):
next(reader, None)
for row in reader:
print(row[0])
read_csv(path)
I Looking for a technique to skip the 9 headers rather than the range function. Any help would be appreciated. Below is a sample of the csv file
Summary Journal Entry,JE-00000060
Journal Entry Date,28/02/2015
Accounting Period,Feb-15
Accounting Period Start,1/02/2015
Accounting Period End,28/02/2015
Included Transaction Types,Invoice Item
Included Time Period,01/02/2015-09/02/2015
Journal Run,JR-00000046
Segments,
,
Customer Account Number,Transaction Amount
210274174,545.45
210274174,909.09
210274174,909.09
210274174,909.09
210274174,909.09