I am trying to fetch last record of csv file using below code.
Nothing gets printed as an output.
I have 101 records in csv file. Need to fetch last record of file
Code :
import csv
count = 0
with open('/folder/emp.csv','r') as csvdt:
csv_rd = csv.reader(csvdt)
get_record_count = len(list(csv_rd)) #101
for j in csv_rd:
if count == get_record_count:
print(j)
else:
count = count + 1
What is internally happening which does not let me print output ?