Read a .txt data file with and keep the last row of good data?

2 views (last 30 days)
Hello folks- I am trying to do some very simple data analysis of the experiment I am running. My experiment gives me a text file with rows of data, sometimes there is just one column but when it is capturing the good data there are two columns (first time always captured, second the measurement I am interested in)
This is what I want to do for example
0.0 0.1 0.2 3.23 0.3 0.4 5.21
I want to just save the two rows with the good data, is there an easy way to do this?
At the end goal here is to just get the last row, last column, or for instance that 5.21 is the number i want to capture.
  1 Comment
Cedric
Cedric on 20 Nov 2013
Edited: Cedric on 20 Nov 2013
Could you provide/attach a sample file? You say that you want the last two rows at one point and then that you want the two rows with good data.. the first statement means
0.3
0.4 5.21
and the second statement means
0.2 3.23
0.4 5.21
So which one is it? And if it is the first and there are good data on the last two rows, e.g.
0.0
0.1
0.2 3.23
0.3 10.82
0.4 5.21
do you need to get 10.82 and 5.21?
In case you can;t provide a sample file, is the line
0.4 5.21
the absolute last line in the file (meaning that there is nothing after)?

Sign in to comment.

Answers (0)

Categories

Find more on Data Import and Analysis in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!