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