简体   繁体   English

使用 textscan 将制表位读取为 4 个空格

[英]reading tabstops as 4 whitespaces using textscan

Is it possible to tell MATLAB's textscan to import tabs as four whitespaces?是否可以告诉 MATLAB 的textscan将制表符导入为四个空格? Currently it's replacing a tab with just one whitespace:目前它只用一个空格替换一个选项卡:

raw = textscan(fid,'%s','Delimiter','\n','Whitespace','');

Thank you in advance :)先感谢您 :)

Thank you @Dev-iL,谢谢@Dev-iL,

I thought maybe there is some option to add to textscan, but now I added as you suggested another line of code:我想也许有一些选项可以添加到 textscan,但现在我添加了你建议的另一行代码:

raw = textscan(fid,'%s','Delimiter','\n','Whitespace','');
raw = regexprep(raw{1},'\t','    ');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM