What changed about matlab and tabs in a recent update?
Show older comments
I am using (fairly simple) code to cut out part of a tsv file. This code is working in R2018b but not in R2020b:
line_cell = strsplit(tlines{i}(), '\t');
Where tlines is an array of strings with tabs such as
tlines{4}() = 'g1 : 14.203 79.931 50.598'
Now R2018b give me
1×5 cell array
{'g1'} {':'} {'14.203'} {'79.931'} {'50.598'}
As it should. But R202b give me:
1×1 cell array
{'g1→:→14.203→79.931→50.598'}
What changed in the updates and how can you get the old (correct) functionality back?
1 Comment
Jan
on 29 Jan 2021
What is the meaning uf the "()" in: tlines{i}() ?
Accepted Answer
More Answers (1)
tlines = sprintf('g1\t:\t14.203\t79.931\t50.598')
split(tlines, '\t') % tlines{4} does not contain the characters \ and t
split(tlines, sprintf('\t')) % but it does contain the tab character
1 Comment
Timotheus Berg
on 29 Jan 2021
Categories
Find more on String Parsing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!