Filter löschen
Filter löschen

how do I display all the text on one line?

8 Ansichten (letzte 30 Tage)
Emanuela riccio
Emanuela riccio am 20 Mär. 2020
Kommentiert: Adam Danz am 21 Mär. 2020
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

Akzeptierte Antwort

Adam Danz
Adam Danz am 20 Mär. 2020
Bearbeitet: Adam Danz am 20 Mär. 2020
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 Kommentare
Emanuela riccio
Emanuela riccio am 20 Mär. 2020
Bearbeitet: Emanuela riccio am 21 Mär. 2020
Thanks with the heart, Adam I solved all the problems. You have been precious to me!
Adam Danz
Adam Danz am 21 Mär. 2020
Glad I could help.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Monika Jaskolka
Monika Jaskolka am 20 Mär. 2020
Did you try removing the newlines (or other formatting characters)?
  5 Kommentare
Monika Jaskolka
Monika Jaskolka am 20 Mär. 2020
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 am 20 Mär. 2020
Bearbeitet: Emanuela riccio am 20 Mär. 2020
ok monika the file is swire and it is about 100 pages ...thanks always

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Data Type Identification finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by