Skip to content
RetroFloppySupport edited this page Dec 23, 2018 · 6 revisions

Transformenator

Transformenator is a tool (a set of tools, really) that makes it possible to do some very in-depth conversion of files from one "format" to another. It turns out that this is really, really useful when faced with files from ancient word processors, for example. They used all kinds of crazy binary annotations within a file (this is before the days of text markup, remember). With Transformenator, it's easy to swap out those binary annotations for HTML or RTF tags that all of a sudden make those ancient files readable again, maybe even with their original formatting and highlighting intact. Many samples come built into Transformenator that can make such file conversions easy. The list of these samples is available in git at this link.

There are some other things Transformenator can do that are along these same lines - extracting individual files from a disk image of some very ancient computers, converting structured records in a file into Comma Separated Values (CSV) for use in a modern spreadsheet, and some other miscellaneous utilities to aid repetitive conversion of lots of related files.

Useage

All of Transformenator's functions come packaged as a Java Jar file. There are shell and batch scripts to make invocation easier; but you can always call it from the command line directly:

java -jar transformenator.jar

The default thing it does is basic file transformation. A set of rules (comprising a transform) are applied to the input file and written to the output file. You can use one of the included sample transforms, or you can write your own as simply as creating a text file.

For example: java -jar transformenator.jar transform infile out_directory

Where:

  • transform is the name of a file containing the set of transformations you want to make
  • infile is the original file or directory to act on
  • out_directory is the the directory location of the resulting file(s) after making all transforminations

Example

Say you have the file below named infile, and we might inspect its contents as represented in a typical hex editor:

(Offset) (Hex data)                               (ASCII representation)
-------- ---------------------------------------  ----------------
0000000: 6162 6364 0000 6566 6768 696a 1a67 6574  abcd..efghij.get
0000010: 2072 6964 206f 6620 6d65 210a            rid of me!.

Say we want to change the hex zeroes in the middle to spaces, and eliminate anything after the End Of File character (0x1a). We can create a transform file named transform to do just that:

; Convert nulls into spaces
00 = 20
; ASCII EOF character really means EOF
1a = "{@@<FiLe_EoF>@@}"

So, we run infile through the transform file and send the output to a file still named infile in the directory out_directory:

java -jar transformenator.jar transform infile out_directory

The resulting infile within the out_directory looks like this now in a hex editor:

(Offset) (Hex data)                               (ASCII representation)
-------- ---------------------------------------  ----------------
0000000: 6162 6364 2020 6566 6768 696a            abcd  efghij

Observe that nulls became spaces, and other trailing stuff after the EOF character has been removed.

Additional Functions

Transformenator can make these transform-based conversions across an entire directory of files without any additional scripting. The specified infile can either be a file or a whole directory tree full of files.

The other functions that Transformenator can do are outlined on the Utility Functions page.

Further Reading

Clone this wiki locally