textscan(f​id,'%s','d​elimiter',​{'\r','\n'​}) lost a Tab located in the very beginning of 1st row of text file

4 次查看(过去 30 天)
Hi, I am using textscan to read a tsv file.
This tsv file has an empty cell in the {1,1} position, but the textscan lost this tab:
afn = 'C:\Users\rmd\Desktop\test.txt';
fid = fopen(afn,'r');
rawData = textscan(fid,'%s','delimiter',{'\r','\n'},'MultipleDelimsAsOne',1);
rawData{1}
'genotype date age n_genes n_counts mt_frac cell_types_integrated broad_annotation neurotransmitter UMA…'
'AAACCCACAACATACC-1-mini-2020-06-18-5d mini 2020-06-18 5d 1018 1781.1062 0.039784227 N-53-Glut Neuron Glu…'
'AAACCCACAACTTCTT-1-mini-2020-06-18-5d mini 2020-06-18 5d 841 1575.952 0.04052638 N-0-undef Neuron undefin…'
'AAACCCAGTAGTCTGT-1-mini-2020-06-18-5d mini 2020-06-18 5d 1667 4609.9756 0.00064537866 N-6-GABA Neuron…'
How to let textscan get that tab?

采纳的回答

埃博拉酱
埃博拉酱 2023-4-7
Specify Whitespace='' in textscan.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Large Files and Big Data 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by