Multiple delimiters for readtable
조회 수: 33 (최근 30일)
이전 댓글 표시
Hello,
the data is stored in a text file like this:
Nb11(tab)Nb12 + Nb13 Nb14 + Nb15 Nb16 + Nb17
Nb21(tab)Nb22 + Nb23 Nb24 + Nb25 Nb26 + Nb27
I've tried to use the readtable command:
t = readtable('data.txt','Delimiter','tab +', MultipleDelimsAsOne, true)
and I obtain 4 columns instead of 7:
Nb11Nb12 Nb13Nb14 Nb15Nb16 Nb17
Do you have any suggestions in order to obtain 7 columns?
Thanks
댓글 수: 0
채택된 답변
Star Strider
2019년 6월 11일
To specify more than one delimiter, use a cell array of character vectors:
t = readtable('data.txt','Delimiter',{'tab', '+'}, MultipleDelimsAsOne, true)
댓글 수: 2
Star Strider
2019년 6월 11일
As always, my pleasure.
I always use the character string designations, such as '\t', for the delimiters.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Cell Arrays에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!