Reputation: 4736
I have a text file in the following url.
http://hosted.stats.com/ifb2009/data.asp?file=en/chlg_standings.txt
I want to parse this text file and display the data as groups, teams etc. Can anyone please let me know how to parse text file.
Upvotes: 0
Views: 1108
Reputation: 38168
It's a java question, not an android specific question.
The best is to use a BufferedReader
on your file (or stream).
Then use readLine
to get one line.
Then use String.split
or String.indexOf
to parse your data.
Upvotes: 2
Reputation: 30235
Probably the best thing to do is use a Scanner that way you can easily specify your used delimiters and read data in its correct form (readXXX()). Also you can use the same logic independent of where the file is from by replacing the Stream in the constructor with another.
Upvotes: 2