I have the following lines in a file where I want to take the third column; In the file I don't have the numbers column:
- Red; Blue; Green; White; Orange;
- Green; White; Orange;
- Blue; Green; White;
- Red; Blue; Green; White;
- Blue; Green; White; Orange;
- Orange
- Green; White; Orange;
- White; Orange
- Green;
I used this code line to do that:
lines = i.split(";")[2]
The problem is that some of the lines have only one column or two, so it gives me 'index out of range' error. Please tell me how to go about this problem?
thanks a lot Adia