How to edit specific lines of a large text file?
3 ビュー (過去 30 日間)
古いコメントを表示
Hi all, I have a large text file, about 7000 lines, and I need to read and edit specific lines, 300 lines, in the middle of the file. How can I skip unneeded lines?
2 件のコメント
ES
2017 年 3 月 24 日
Some more details?
Do you know which specific line number, line content you should start editing?
採用された回答
dbmn
2017 年 3 月 24 日
If you already know the line number that you need to edit, I suggest to use one of the following solutions on matlabcentral https://de.mathworks.com/matlabcentral/answers/62986-how-to-change-a-specific-line-in-a-text-file
If you dont know your line number yet, but know some test-marker (f.ex. TEMP....TEMP) you can read on the Matlab functions
regexprep
regexp
or check out this answer
hope this helps.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Text Data Preparation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!