0

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.

3 Answers 3

2

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.

Sign up to request clarification or add additional context in comments.

Comments

2

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.

Comments

1

String.split(..) if it is simple. If it is more complex, you could use regex

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.