How do you recognize an empty line?

16 vues (au cours des 30 derniers jours)
dmfwlansejr
dmfwlansejr le 8 Nov 2022
Hi-
How do you recognize an empty line?
There is actual data after the blank line in the file
be shown below..
____________________________________
sada
sa
sd
This is empty line
abc123
cde357
.
.
.
.
___________________________________
Thanks!

Réponses (2)

Marcel
Marcel le 8 Nov 2022
Modifié(e) : Marcel le 8 Nov 2022
I think there are many ways to check this.
you can try to check in many ways. just take a look at the example below. be creative :p
code untested.
if line == "" |
line == " " |
isempty(line) == 1 |
strlength(line) == 0
% line was empty
end

Walter Roberson
Walter Roberson le 8 Nov 2022
Check isempty(strtrim(LINE))

Catégories

En savoir plus sur Functions dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by