Clear Filters
Clear Filters

search for aline in text file a delete it!

1 view (last 30 days)
Hi! i have a text file . in this file i have text and measurement data. the text is not mixed with the data. in each line i hve data OR Text.
exempele:
measurement data1
Freq mag S D
1 2 3 3
2 4 5 8
1 4 5 6
measurement data2
Freq mag S D
1 2 3 3
2 4 5 8
1 4 5 6
and so on ans so fort..............
Thank for the help

Accepted Answer

Jan
Jan on 6 Nov 2012
The question is not clear. Does the file contain the empty lines or is this an artifact of pasting to the forum? Please post the exact input and the wanted output. Consider, that you cannot delete characters inside a text file. You have to import the file, remove the lines in the memory and re-write the file afterwards.

More Answers (1)

Rica
Rica on 6 Nov 2012
input:
measurement data1
Freq mag S D
1 2 3 3
2 4 5 8
1 4 5 6
measurement data2
Freq mag S D
1 2 3 3
2 4 5 8
1 4 5 6
the wanted output:
%
1 2 3 3
2 4 5 8
1 4 5 6
1 2 3 3
2 4 5 8
1 4 5 6
Thank u!

Tags

Community Treasure Hunt

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

Start Hunting!