0

On a Linux PC I saved a plain text file named tt-1.txt with 'xed' text-editor. The size of tt-1.txt is 1.7 MB according file-manager --> properties. Then I copy the content of the tt-1.txt in tt-2.odt file with LibreOffice Writer 7.2

Then I see the size of the tt-2.odt with file-manager --> properties and it is ... 620,8 kB!? How it is possible?

2
  • 1
    It is not the same file. You save the content to 2 different formats (txt and odt). As the formats are different, you will not get the same size as they save files differently. Jan 16 at 18:25
  • odf specs
    – A.B
    Jan 16 at 18:27

1 Answer 1

1

Short answer: both files contain the same text, however the formats are different so the sizes are different as well.

Long answer: TXT files usually use 1 byte per character; if your text is normal (no special characters like emoji) the size of the file in bytes is the number of characters (letters, spaces) in the text. This also depends on CR and LF characters and a final end of file which might be added by your text editor or not.

When 1 byte per character is used and the text is normal (taken from a book, for example) only a small subset of all possible ASCII characters is used. As a result, the text could be saved more efficiently by using less bits per character.

Programs like Word or LibreOffice are aware of this and use compressed formats which automatically reduce the length of the file depending on the possible optimizations. However, these formats cannot be read by a plain text editor.

In the case of Word, docx-documents are basically ZIP-files.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.