I am trying to write the data from a Text file into an ArrayList. I have the code below. The lines in the text file have this format:
Id
Car Manufacturer
Car Type
Colour
*blank line*
For Example:
21
Vauxhall
Corsa
red
19
Vauxhall
Corsa
blue
18
Vauxhall
Corsa
White
It does this 24 times, displays the information correctly when run, but the size of the list is "1". I was wondering if it is possible to split up each car by the blank space so they can be individually separated.
,\s*, i.e. a comma followed by any whitespace, but your description doesn't mention that comma.id,car manufacturerand so on in one line for each car or in separate lines?