We know that clinical data analysis result charts will eventually present the results in RTF format, opening similar word documents.
What is rtf format?
Rich Text Format (RTF) , also known as Multi-Text Format, is a cross-platform document format developed by Microsoft Corporation. is a lightweight editable document format.
Why use RTF?
Advantages of RTF format:
(1) Universal compatibility is the biggest advantage of RTF, which can realize multi-platform information compatibility.
(2) RTF format files can transfer data between different programs and different versions of the same program, and its format information will not be lost or damaged.
RTF file is an open source code file format, you can open and view its source code with editors such as Notepad, Notepad, etc. You can use "Notepad" to edit RTF format files just like editing HTML files.
Compared with RTF, WORD is a heavyweight document editor. With Word software, you can edit text graphics, images, sounds, animations, and insert information made by other software. You can also use the drawing tools provided by Word software to create graphics. Make, edit word art, mathematical formula, can meet the user's various document processing requirements.
We can open an RTF file and look at the source code:
When we save the RTF as a word document, look at the source code:
It can be seen that it has actually been converted to bytecode . In this way, we cannot edit Word by means of code, and its core is still the compiler or interpreter of Microsoft Word. RTF is actually equivalent to a part of the format that Microsoft has open sourced from word.
It is also the same file, and the code behind it is displayed differently due to different formats.
We can take a look at using Python to merge all RTFs in the current folder, and the result is less than 1 second.
The essential reason is that in the process of merging, the program reads the characters behind it, just like reading and merging txt.