I finally got my dbf file to be a csv but now I am confused as to how to parse this out into a text file for further editing.
I have been reading up on the csv module but to be honest my head began to spin. So much of it seemed Greek to me. However, I would like the code for using module this if possible.
My car.csv file looks like this:
Name,Total,Freq
Toyota,2,2
Mazda,1,1
Kia,2,1
Volkswagon,3,1
I want to output the following sentence into a text file (or csv):
Within this neighborhood there is a Toyota, Mazda, Kia, and Volkswagon parked on the street.
If the results are two I do not want commas:
Cars.dbf
Toyota,2,2
Mazda,2,1
Within this neighborhood there is a Toyota and Mazda parked on the street.
Cars.dbf
empty
There are no cars parked on the street within this neighborhood.
I got a good suggestion from a previous post on constructing the if-else sentences but am lost on how to parse columns (they didn't show up in Excel for some reason, I thought I only had one column)
python 2.7
BTW. Anyone know of a good web site that explains the csv module in terms a total newbie can understand? Thanks.