Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Is there a way, when reading a file to insert text between a deliminator.
조회 수: 1 (최근 30일)
이전 댓글 표시
My file has a header line that looks like this
[Column a, Column b, column c, colunm d;]
and then following rows with information like this
[1,1,,1;1,1,,1;1,1,,1]
I've been using the strtok function to separate the values but since there is no character between the commas in the third column, it doesn't recognize it as anything and shifts all my information over one column. Is there a way to insert a value into that column.
댓글 수: 0
답변 (1개)
AJ von Alt
2014년 8월 22일
Use strsplit with "Collapse Delimiters" disabled.
inputstr = '[1,1,,1;1,1,,1;1,1,,1]';
C = strsplit( inputstr , ',' , 'CollapseDelimiters' , 0 );
C =
'[1' '1' '' '1;1' '1' '' '1;1' '1' '' '1]'
댓글 수: 0
이 질문은 마감되었습니다.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!