how to read text file,showing the same formatting as text file....like BOLD,ITALIC

6 次查看(过去 30 天)
i want to search headings from any text file

采纳的回答

Stephen23
Stephen23 2015-2-16
编辑:Stephen23 2015-2-16
According to most common definitions of text files , they do not contain any formatting meta-data such as bold or italic information, so what you are asking for is in itself already a contradiction.
Text files might include formatting information using some kind of markup language , such as HTML or Markdown , in which case you can read this into MATLAB just by reading the text data itself.
If you are actually talking about formatted document standards (such as .doc, .odf, etc), then these do include formatting text data, but the files are in fact binary data and not text data and so cannot be (usefully) imported into MATLAB as text.
MATLAB' standard character data class also only handles raw character encoding (usually two-byte), not formatted strings, so if you need to handle strings with formatting then you would probably need to write your own data class to do this.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Text Data Preparation 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by