I wrote a code that seems to work. At least, it appends new data rows and sorts the file.
For convenience, I will use an array to append new lines. What I need is the meaning of the last 4 column contents. After studying all avatars files, I came to this:
TYPE
SPACE
Seems to be personal space. I would appreciate the values meanings.
PALETTE
As I understand the way bmp files are set, I really don't understand the 0 and 1 values meanings. I guessed 0 = un paletted, 1 = paletted. But so many unpaletted animations get a 1 value.
SIZE
Seems to be used only for CHARACTERS animations, except 0x2200 OGRE_MAGE (which is also a paletted animation and nothing mention it in the file ?)