Hi Guys,
I am trying to process the data in a text file. Problem is that the data is in a strange format. The data is a bunch of attributes about Dogs - but instead of having the data for each dog in the file on a single line (which would just allow you to use the StringTokeniser to break it up), it is spread accross 3 lines, in the following format:
Each dog (therefore each 3 lines) must be processed seperately. I have been sucessful in processing this data for the first dog in the file, but I am a bit stuck on how I should loop through the rest. I was thinking that I could use a 'for' loop, but that would require knowing how many lines there are in the file - is there anyway of knowing this?
Does anyone else have any ideas on how I might so this?
Cheers
I am trying to process the data in a text file. Problem is that the data is in a strange format. The data is a bunch of attributes about Dogs - but instead of having the data for each dog in the file on a single line (which would just allow you to use the StringTokeniser to break it up), it is spread accross 3 lines, in the following format:
Code:
<ID> <breed>
<temperament>
<neutered?> <age> <length of stay>
123 Kelpie
friendly, active
no 2.4 4
Does anyone else have any ideas on how I might so this?
Cheers