how do I display all the text on one line?

18 ビュー (過去 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 Center および File ExchangeData Type Identification についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by