Hi - This is a simple problem, I'm sure, but I'm stumped. I need to read only one column from a multi-column file. The column is always in the same position, so I've decided to simply isolate the location in the row while reading the data. Here is my code:
data = open ("files/" + data + ".txt", 'r') for line in data: line = line[34:38] file_list = line.readline()
But I'm getting an error message which says: "AttributeError: 'Str' has no attribute 'readline'
The data appears as follows:
Thanks so much for your help. Also, if you can suggest a better way just to read one of the columns, that would also be appreciated. I know I'm in trouble if the characters between each comma start to vary. grant-