Keep space at beginning of a row (textscan)
25 次查看(过去 30 天)
显示 更早的评论
I have a file I am reading in with textscan, which works perfectly, except when there is a space at the beginning of the line that I'm reading in. I have it delimiting at the end of a line ('\n'), which is fine, it just drops any whitespace at the beginning of the line, which is not okay. Is there any way to tell it to read the file lines in exactly?
Ex: I want it to read in " 100" as " 100", not "100".
Thanks! Sarah
0 个评论
采纳的回答
Jan
2013-6-10
Perhaps disabling all white-space removing helps:
textscan(fid, '%s', 'delimiter', '\n', 'whitespace', '')
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Import and Export 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!