String Tokenizing (but a little harder)
I have to read inlines from a file. It goes like this:
ID A1 A2 A3 A4 Midterm Final
35 35 35 30 30 100
133502 25 14.5 31.5 30 19.5 60
154741 5 5 17 17 69.5
157880 34 15 35 30 18 76.5
158140 25 11 12
and so on.
The top line is just headers. The second is what everything is out of.
Below that everything is layed out. Now this would be easy if all values were put in. However Every blank space is supposed to be a zero.
So using a string tokenizer how would I be able to read in say lines 1 and two and get something like this.
Student 1 has ID 133502, and marks [25,14.5,31.5,19.5,60]
Student 2 has ID 154741, and marks [5,0,5,17,17,69.5]
and so on?
Using just basic String tokenization it would ofcourse skip the blank in student two and would only give me four marks. Any tips on how to do this? Atleast point me in the right direction^^ Thx
Edit: I uploaded the txt file since it wasnt showing it right.
Last edited by p1kn1c; 01-14-2006 at 03:56 PM.
By mdengler in forum ASP.NET
Last Post: 11-26-2002, 03:32 PM
By Fred Mayes in forum Java
Last Post: 06-05-2001, 07:12 AM
By Julian Milano in forum VB Classic
Last Post: 08-10-2000, 10:16 PM
By chandra in forum VB Classic
Last Post: 06-22-2000, 08:36 AM
By Robert Rieth in forum VB Classic
Last Post: 04-11-2000, 04:21 AM
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL