How to import Table and column header from two diffrent files?
조회 수: 6 (최근 30일)
이전 댓글 표시
hey guys i have a problem importing data from my .csv file and my headers from my .txt file
when i open my data.csv in excel i get them in a single column with a '','' delimiter between them.
my txt file contains my headers for data columns they are seprated with a ''|'' delimiter .
how can i import these into a single table which i can work with ?
i tried readtable or importdata but couldnt find the correct options
btw im using matlab online r2020b and im trying to do everything with program code to use as in my internship report
댓글 수: 0
채택된 답변
dpb
2020년 11월 21일
W/o an example to confirm but from the description alone something like:
tData=readtable('thedatafile.csv');
hdrs=readcell('thehdeadersfile.txt');
tData.Properties.VariableNames=hdrs;
Which begs the question of why not create a single file containing column headings and data together to begin with?
댓글 수: 2
dpb
2020년 11월 26일
Would have to see the code and the actual file to know...although the code and error in context might point to the cause. In general, we can't diagnose what we can't see.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Spreadsheets에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!