How do you recognize an empty line?

조회 수: 10 (최근 30일)
dmfwlansejr
dmfwlansejr 2022년 11월 8일
답변: Walter Roberson 2022년 11월 8일
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!

답변 (2개)

Marcel
Marcel 2022년 11월 8일
편집: Marcel 2022년 11월 8일
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 2022년 11월 8일
Check isempty(strtrim(LINE))

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by