I can successfully read a text file using the InputFileStream and Scanner classes. It is very easy, but I need to do something more complex than this. A little bit about my project at the beginning. I have a device with sensors, and I use a recorder that will record data from sensors every 10 seconds in a text file. Every 10 seconds is a new row of data. So what I want, when I read the file, is to capture each individual sensor into an array. For example: speed altitude latitude longitude
22 250 46.123245 122.539283
25 252 46.123422 122.534223
Therefore, I need to take the height data (250, 252) into the alt [] array; etc. vel [], lat [], long [] ...
Then in the last line of the text file there will be different information, just one line. It will have a date, distance traveled, timeElapsed ..
So, after a little research, I came across the classes InputStream, Reader, StreamTokenizer and Scanner. My question is which one would you recommend for my case? Is it possible to do what I need to do in my case? and whether he can check what the last line of the file is, so that he can capture the date, distance, etc. Thank!
t0x13 source
share