Ask Your Question
0

Hex Edit in Libreoffice Writer?

asked 2018-08-08 08:12:56 +0100

bkpsusmitaa gravatar image

updated 2018-11-10 06:45:41 +0100

While editing a sample Text File with ghex I found the following ideas: Line Break (with shift enter): "0C0D0A"C:\fakepath\0c0d0aLineBrk.odt (edited on 10th Nov 2018) Paragraph Break: "0A" Space: "20" Space: "0D" and so on.

Using ghex I was able to remove some stubborn non-printing characters that were difficult to edit by Writer using Find/Replace, including a code in text file that resulted in a page break in the file when viewed by Writer.

Now when I create a sample Writer edited *.odt file and check, it is full of hex characters that has no resemblance to the characters/text that I have entered. Moreover, its all gibberish.

May be, because of encryption?

If I now open the ~'lock.' file, I see the following:

Knoppix User,knoppix,Microknoppix,08.08.2018 10:29,file:///home/knoppix/.config/libreoffice/4;

How could I read a Writer file in hex code without enabling encryption? It will help a great deal in removing stubborn formatting.

After sufficient investigation for a few of days from posting this query, I had found out the exact hex code for creating a line break. But forgot to report here. I am attaching the file written in a text only editor, renaming the file as .odt, only introducing the code 0C0D0A using a hex editor.

Got the line break :-D (-D

Thanks everyone who helped.

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
1

answered 2018-08-08 09:08:01 +0100

ajlittoz gravatar image

If you just want to have a look at the way how LO encodes document formatting, save it as .fodt (aka. "flat XML"). Zip compression is skipped and you end up with a text document which can be opened with any text editor.

As @Mike Kaganski wrote, it is an XML file translating all your formatting instructions into so-called ODF flow. Refrain from tampering directly, you will surely destroy the consistency and your document will become unusable. Though there are exceptional circumstances in which patching the XML is the last resort, you don't seem to be in such a context.

Note: the "stubborn non printing char" causing a page break is Form Feed or "FF", coded as U+000C and is historically intended for this usage.

edit flag offensive delete link more

Comments

Thank you. Regards

bkpsusmitaa gravatar imagebkpsusmitaa ( 2018-08-16 15:11:32 +0100 )edit
1

answered 2018-08-08 08:18:45 +0100

Mike Kaganski gravatar image

updated 2018-08-08 08:21:02 +0100

.ODT is a zipped directory full of XMLs and attached binaries (like JPGs). Lock file is a simple text file telling who has opened the file, when and where.

To convert between a character and its Unicode representation in Writer UI, select the character, and press Alt+X; select the resulting code (like U+00a0) and press Alt+X to convert back to character.

edit flag offensive delete link more

Comments

Thank you. Regards.

bkpsusmitaa gravatar imagebkpsusmitaa ( 2018-08-16 15:11:48 +0100 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2018-08-08 08:12:56 +0100

Seen: 80 times

Last updated: Nov 10