Computer Communication & Consulting

zettel2text - Linux Tool for ZMzettelkasten

last change 2009-11-01

zettel2text - simple Repair & Export Tool for ZMzettelkasten

zettel2text V 0.20 is available Download

German version of this page - click on flag or here.

The command line tool zettel2text is able to verify and/or convert file from ZMzettelkasten-format (Version 2.6) into text files which may be handled with standard Linux utilities.

Version 0.20 supports files with keyed slips. But they will not be printed.

New in Version 0.12 is the cabability to export a ZMzettelkasten-file in a CSV-Text-format. This allows you to import the data into other programs.

ZMzettelkasten-files use a special format. It is similar to a database file, since it needs to have a defined number of datasets per each slip. All this sets are separated by hex-zero. So far the ZMzettelkasten files may not be processed by standard utilities.
zettel2text converts a ZMzettelkasten-file independend if it is consitant or defectiv in a normal ASCII-textfile. This allows an eventual repair with standard tools i.e. Text Editor or the further data processing with other tools.

The program has to be called from command line and needs minimum a filename as parameter.

bernd@mars:~/daten/cprog$ zettel2text test.zkx
- InFile=test.zkx
  ==> OutFile=test.txt
Datei test.zkx size = 2718
[00- 1] Head: Version2.6
[00- 2] Desc: Dies ist eine Test-Datei
[00- 3] Anzahl Zettel = 37
*** Header fertig - weiter mit Data ***
37 Zettel mit 296 Feldern gefunden
Anzahl Felder ist richtig
Größter Zettel = 229 Zeichen

As to see in the above example the slip-box file test.zkx is checked firts an converted to the normal text file test.txt right after. You will get also some information about the contents. In teh example it means: Header ok - continue with Data, 37 Slips found with a total of 296 Fields (= correct there are 8 fields per slip) .. the biggest slip has a size of 229 Bytes.

To be able to reconvert the text file into a slip-box, the text file contains TAGs so zettel2text can interpret the text lines.
See the following example:

bernd@mars:~/daten/cprog$ cat test.txt
<DESC>Dies ist eine Test-Datei
<--- Zettel ---> 0
<TITEL>Zettel 1
<STICH>Stichwort 1,zettel,kasten
<AUTOR>Autor 1
<NOTIZ>Vermerk 1
<DATUM>Datum 1
<EXTRN>Extern 1
<--- Zettel ---> 1
<TITEL>Zettel 2
Text 2
mit Formatierung
<STICH>Stichwort 2,noch,ein,Stichwort
<AUTOR>Bernd Holzhauer


<DATUM>Erstellt: 22.9.2002;Geändert: 21.2.2007
<--- Zettel ---> 36
<TITEL>Zettel 37
und noch ein bisschen
<AUTOR>siehe zmzettelkasten.zkx Zettel 12
<NOTIZ>dieser Eintrag ist zum Testen
<DATUM>Erstellt: 21.12.2006;Geändert: 18.3.2007

The TAGs <HEAD> <DESC> und <ZAHL> each only exit ones in the file header.
<HEAD>Version2.6represents the File version.
<DESC>Test Dateiwill be followed by the file comment.
<ZAHL>##Number (Zahl) of slips (Zettel) in the slip-box
After that per each Slip (Zettel) you will see 8 entries:
<--- Zettel ---> ##Cutting Line per Slip (Zettel) the slip No starts counting with 0 (Zero) therefore each No. here is smaller by one compared to the GUI.
<TITEL>Slip Title (one Line only)
Slip TextThe text of Slip w/o special Tag - multiline - all Lines between TITEL and STICH are slip text.
<STICH>Catchwords, colon ',' separated (no linefeeds)
<AUTOR>Author & Source-Reference (multiline)
<LINKS>Numbers from 0 until Zahl-1 (colon ',' separated)
<DATUM>Created: date ;Changed: date
<EXTRN>External Links, Semicolon ';' separated (no linefeeds)

During Editing with a standard Editor it is very important to check for the correct number of lines as well as the content of the lines. If there is an Error it will be impossible to reconvert back to a ZMzettelkasten file. TAGs have to be in the first place of a line i.e. without leading whitespace. Otherwise they will not be processed during backward conversion.

zettel2text -r test.txt invokes conversion of a taged textfile into a ZMzettelkasten formated file. The output file is everytimes colled repair.zkx. This prevents the original datafile from overwriting. After checking the consistency by ZMzettelkasten repair.zkx you should cp to copy the repair.zkx over your slip-box file.

zettel2text -c test.zkx converts your slip-box file into a colon separated text file test.csv. This allows you to Import of the dat into for example an OpenOffice spreadsheet. Because the Slip-text usualy contains a lot of linefeeds and quotes this import maybe restrikted.
Tip: test this functionality with a small test slip-box in advance

Download zettel2text Version 0.12

Terms of use:

The program is Freeware and your are able to download and use without any fee. You are using the program on your own risk. I am not responsible for any data losses and/or data corruptions.

Before you offer this program on your web-site for download or put it onto a CD for distribution please contact me for an allowance. It like to know what's going on.

(c) 2007-2008 Bernd Holzhauer

download zettel2text - size 14kB - executable Binary for Linux command line.
Just execute ./zettel2text dateiname after Download.

Best practice is to place the program with sudo cp zettel2text /usr/local/bin into the /usr/local/bin dirctory.

With downloading and/or using the program you accept the »Terms of use« above.

Questions, Suggestions or Error descriptions? Please email to me.

Home Page
Copyright © 2001-2010 Bernd Holzhauer. All Rights reserved.
Possibly used Trademarks are Properties of their owners.