Tokenizing textfile content into several Tables (Float)
I have a file (selected via JFileChooser), where content is
...<some unnecessary text>...
A B C
0.004 0.344 0.124
5.003 0.412 8.299
1.993 0.234 5.3333
0.234 ...... ......
.....<some unnecessary text>
Number of whitespaces between various "numbers" (tokens) is NOT fixed but in each line I have 3 tokens.
I want to create 2 tables:
- Float tblA - containing all tokens from "A" column and
- Float tblB - for "B" column.
I was thnking about StreamTokenizer but also found out class Scanner and String method split(). Anyway, I cannot obtain the result I want in any of these methods.
Can you tell me the most effective way to:
- cut unnecessary part
- convert tokens from file into 2 tables (parsed into Float)