I'm pretty sure this kind of book reordering was a punishment envisaged in Iain M Bank's Player of Games:
His most famous exploit had been the sacking of the Urutypaig Library. Traff had been in command of a small ground force in a war against a humanoid species; the war in space had been fought to a temporary stalemate, but through a combination of great military talent and a little luck Traff found himself in a position to threaten the species capital city from the ground. The enemy had sued for peace, making it a condition of the treaty that their great library, famous throughout the civilised species of the Lesser Cloud, be left untouched. Traff knew that if he refused this condition the fight would go on, so he gave his word that not a letter, not a pixel, on the ancient microfiles would be destroyed, and they would be left in situ.
Traff had orders from his star marshal that the library had to be destroyed. Nicosar himself had commanded this as one of his first edicts after coming to power; subject races had to understand that once they displeased the Emperor, nothing could prevent their punishment. While nobody in the Empire cared in the least about one of its loyal soldiers breaking an agreement with some bunch of aliens, Traff knew that giving your word was a sacred thing; nobody would ever trust him again if he went back on it.
Traff already knew what he was going to do. He solved the problem by shuffling the library, sorting every word in it into alphabetical order and every pixel of every illustration into order of colour, shade and intensity. The original microfiles were wiped and re-recorded with volumes upon volumes of the's, it's, and and's; the illustrations were fields of pure colour.
There were riots, of course, but Traff was in control by then, and as he explained to the incensed and - as it turned out, literally - suicidal guardians of the library, and to the Empire's Supreme Court, he had kept his word about not actually destroying or taking as booty a single word, image or file.