how do I display all the text on one line?

조회 수: 6 (최근 30일)
Emanuela riccio
Emanuela riccio 2020년 3월 20일
댓글: Adam Danz 2020년 3월 21일
Hi everyone, I have a problem: I extracted the text on matlab using str = extractFileText (filename) command, when I press on run my output in the command window gives me the text with the original formatting, while to me you need to make the text appear on a single line. How can I do? thanks in advance to those who answer me

채택된 답변

Adam Danz
Adam Danz 2020년 3월 20일
편집: Adam Danz 2020년 3월 20일
Try this.
filename = 'swire.pdf';
str = extractFileText(filename);
c = regexprep(str,{char(13),char(10)}, ''); % or replace with ' '
size(c{1}) % = 1 x 204710
  댓글 수: 8
Emanuela riccio
Emanuela riccio 2020년 3월 20일
편집: Emanuela riccio 2020년 3월 21일
Thanks with the heart, Adam I solved all the problems. You have been precious to me!
Adam Danz
Adam Danz 2020년 3월 21일
Glad I could help.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Monika Jaskolka
Monika Jaskolka 2020년 3월 20일
Did you try removing the newlines (or other formatting characters)?
  댓글 수: 5
Monika Jaskolka
Monika Jaskolka 2020년 3월 20일
I tried printing text that is 100 lines and I did not experience a problem. Please provide the file that you are using.
Emanuela riccio
Emanuela riccio 2020년 3월 20일
편집: Emanuela riccio 2020년 3월 20일
ok monika the file is swire and it is about 100 pages ...thanks always

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by