Reading .txt file as Table in MATLAB

19 views (last 30 days)
I'm trying to extract a single value from a .txt file. My goal was to make it a table and then just extract the value I need using the indices of the table. I imported it as a table in MATLAB but the tabs don't seem to be done right in the file so the table MATLAB makes is just one column.
This is the .txt file I have (included as attachment)
The only value I need from this file is the 5829124.91427529 number in the bottom right.
Here is the output and then the code for what I was trying to do:
filedata = readtable(file,'delimiter','\t','readvariablenames',true);

Accepted Answer

Marissa Whitby
Marissa Whitby on 8 Oct 2021
I figured it out! In case anyone else has this problem try this:
[X, Y, E] = textread(file, '%f %f %f','headerlines', 9) ; % E is what I wanted

More Answers (0)

Community Treasure Hunt

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

Start Hunting!