Replace comma with dot after fopen
显示 更早的评论
Hello everyone,
I am having some problems with Matlab.
I import a txt file with fopen and, after imported, I want to convert the commas in the file with dots but I do not know how to do. I have searched between the answers in the Matlab Central but I have found nothing.
Thank you for the help.
4 个评论
KSSV
2021-10-19
Read about strrep.
Stephen23
2021-10-19
"I have searched between the answers in the Matlab Central but I have found nothing"
Here are 339 results, many of which are related to file importing:
Daniele Sonaglioni
2021-10-19
Daniele Sonaglioni
2021-10-19
采纳的回答
更多回答(1 个)
fnm = 'trial_file.txt';
opt = detectImportOptions(fnm, 'VariableNamesLine',9, 'VariableUnitsLine',10, 'DecimalSeparator',',', 'ExtraColumnsRule','ignore');
opt.DataLines = [11,Inf];
tbl = readtable(fnm, opt)
类别
在 帮助中心 和 File Exchange 中查找有关 Data Import and Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!