I'm new to python, and trying to understand how to sort data using the csv reader. I've read a couple of guides on this site, but nothing seems to quite relate to what I'm trying.
I have a csv file called buildings.csv, compiled with list data like this:
['VANGARDE MONKS CROSS', '1292', 'YO32 9AE', 'GREAT BRITAIN', 'Retail', 'Trading', '']
['VILLAGE DOUGLAS CORK SF', '418', 'CORK', 'REPUBLIC OF IRELAND', 'Retail', 'Trading', '']
Here is an easy way if you just want to print the lines:
with open('buildings.csv', 'r') as f: for line in f: if(line.find("IRELAND")!=-1): print(line)