Re: [Tutor] list comprehension, testing for multiple conditions

2012-08-21 Thread Johann Spies
#start import re exclude = re.compile('vn|vt|^$|^#') fileName = '/tmp/x' theFileOpened = open(fileName,'r') theTextAsList = theFileOpened.readlines() theTextAsListStripped = [] for aLine in theTextAsList: theTextAsListStripped.append

[Tutor] Deterimining the maximum length of a field in csv file

2010-01-31 Thread Johann Spies
I would appreciate some help on this: I want a script that can 1. determine the fieldnames from a csv file from the first line 2. determine the maximum length of data for each field in that file. So far I could not figure out how to do 1 and my effort for the second one is not working as expecte