
Originally Posted by
Sparkles
That looks like a real challenge! You got 4 attributes (ID, COLOR, MODEL, VEHICLE). Let's call them a1, a2, a3, a4. The pipes are not the issue here (unless the attribute values can consist of pipes also). One could simply replace them with commas or treat them like commas. The format is the problem here. You seem to always have a complete set of all 4 attributes, but there may be any number of additional empty attributes! The attributes also seem to always be ordered in the same sequence.
a1,a2,a3,a4
a1,,a2,a3,a4
a1,a2,,a3,,,,a4
a1,a2,,a3,,,a4,
a1,a2,,a3, ,,a4,
It should be feasible to handle this in java code:
1) continue looking for attributes until you found all 4
2) count the number of attributes so you know which one the current/next will be
3) skip empty attributes