フィルターのクリア

How can I delete specific rows and columns from a text file?

2 ビュー (過去 30 日間)
Mirko Stefani
Mirko Stefani 2019 年 11 月 26 日
回答済み: Michael Chromiak 2019 年 11 月 26 日
Hi everyone,
My aim is to modify the attachment (Q.txt) in the following way:
1) I want to remove all lines starting with "#" except line "# GRDC-No.: 4101250", line "# Latitude (DD): 68.07" and line "# Longitude (DD): -163.19";
2) I want to remove the following coulumns with all their data: "hh:mm" and "Flag"
Thanks in advance to those who know how to give me help.

回答 (1 件)

Michael Chromiak
Michael Chromiak 2019 年 11 月 26 日
It should be enough to load a ".txt" file into the field and search '#' in the "for" loop and delete the rest of the line after it is found except for the selected rows that can be put in the "if" condition

カテゴリ

Help Center および File ExchangeData Import and Export についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by