Removing the first row in data with multiple headers

3 ビュー (過去 30 日間)
Kimmery Migel
Kimmery Migel 2020 年 7 月 16 日
コメント済み: Kimmery Migel 2020 年 7 月 17 日
I have a text file that has 5 rows of headers. I'm using readtable but I want the second row of headers to be the table headers. How can I remove the first row of the header so readtable uses the second row. I have to do this for about 55 files, and am comfortable making it a loop, I just can't get rid of the first row.
sample file is too large to upload, even wem compressed. It can be found here:
  2 件のコメント
per isakson
per isakson 2020 年 7 月 16 日
See detectImportOptions especially
Location Properties:
DataLines: [2 Inf]
VariableNamesLine: 1



jonas 2020 年 7 月 16 日
As per isakson said, use detectimportoptions to fine-tune your table import.
fname = 's03_lab_base.c3d.txt';
opts = detectImportOptions(fname,'VariableNamesLine',2);
T = readtable(fname,opts)
  1 件のコメント
Kimmery Migel
Kimmery Migel 2020 年 7 月 17 日
Thank you so much!!


その他の回答 (0 件)




Community Treasure Hunt

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

Start Hunting!

Translated by