Find a specific word in a textfile and insert 2 new lines in front of it
1 回表示 (過去 30 日間)
古いコメントを表示
Hello,
I've got a very basic question which I can't seem to figure out. I've got a textfile in which I want to find the word 'Observation_3'. Then I want to insert 2 new lines in front of the word 'Observation_3'. Can anyone help?
Thank you.
4 件のコメント
Rik
2020 年 8 月 6 日
insterttext=sprintf('%s\n%\s\n','hello','world');
newfiletext = [filetext(1:(endIndex-14)) insterttext filetext((endIndex-13):end)];
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Low-Level File I/O についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!