MATLAB: How to read text file,showing the same formatting as text file….like BOLD,ITALIC
formattingtext file
i want to search headings from any text file
Best Answer
According to most common definitions oftext files , they donot contain any formatting meta-data such asbold oritalic information, so what you are asking for is in itself already a contradiction.
Text files might include formatting information using some kind ofmarkup language , such asHTML orMarkdown , 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 thesedo include formatting text data, but the files are in fact binary data andnot text data and so cannot be (usefully) imported into MATLAB as text.
MATLAB' standardcharacter data class also only handlesraw character encoding (usually two-byte), not formatted strings, so if you need to handle stringswith formatting then you would probably need to write your own data class to do this.
Best Answer