How to read data out of a .txt-File?

9 ビュー (過去 30 日間)
Philipp Mueller
Philipp Mueller 2021 年 5 月 17 日
編集済み: Monika Jaskolka 2021 年 5 月 17 日
Hello,
I have a .txt-File. How can I read the data? Only the values not the headers.
->
0.0000000000e+00 -9.2010301749e+00
2.0000000000e-03 -9.2061877312e+00
4.0000000000e-03 -9.2118709835e+00
Here is my whole .txt-File:
CharacterEncoding=windows-1213
ColumnSeperator=\t
DecimalSeparator=.
Filename testobj.txt
PreparedBy
Date 2025-06-18
Samplingrate 5000
NumberOfDataPoints 100000
NumberOfTest 1987
NameOfTest ABC
NumberOfChannels 7
ChannelNumbers
0 86767
ChannelNames
time 34343
ChannelUnits
[s] [mm]
DATA
0.0000000000e+00 -9.2010301749e+00
2.0000000000e-03 -9.2061877312e+00
4.0000000000e-03 -9.2118709835e+00

採用された回答

Stephen23
Stephen23 2021 年 5 月 17 日
M = readmatrix('temp.txt','HeaderLines',18)
M = 3×2
0 -9.201030174900000 0.002000000000000 -9.206187731200000 0.004000000000000 -9.211870983500001

その他の回答 (1 件)

Monika Jaskolka
Monika Jaskolka 2021 年 5 月 17 日
編集済み: Monika Jaskolka 2021 年 5 月 17 日
format longE
T = readtable('textfile.txt', 'NumHeaderLines', 18);
T =
3×2 table
Var1 Var2
____________________ _____________________
0.00000000000000e+00 -9.20103017490000e+00
2.00000000000000e-03 -9.20618773120000e+00
4.00000000000000e-03 -9.21187098350000e+00

カテゴリ

Help Center および File ExchangeDates and Time についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by