
  E00b2a : E00 Binary to Ascii

This program converts a binary Arc/Info E00 export file into an
ascii E00 export file.

Copyright :
 
This program may be distributed under the GNU Public License, version 2, or
any higher version.  See section COPYING of the GNU Public license
for conditions under which this file may be redistributed.

Credits :

I started this for my own purpose, but soon Robert L. Sandefur
proposed me his own program which covers some codes I haven't
found.  He sent me also some of the test files in this distribution,
and tested this program under MS-DOS.  Many thanks to him.

Note about e00 format:

This format is considered proprietary by ESRI.  Then my only sources
were public domain data and demos unfortunately sent me as binary e00
files... Don't be surprised if your data are not all converted (you
should the get some messages showing input and output line number where
conversion failed.  The context must the help you to ``guess'' how to
deal with this code.  You can also send me the offending input line (with
some context !) or try to use a WEB based converter (you will find one
at <http://www.geo.ed.ac.uk/~anp/gms/e00.htm>, based on Arc/Info)
This is also a mean to test this program : results must be the same
(except some name strings in IFO section that are renamed by Arc/Info).

A (much) better solution would be to use an ESRI documented format,
such as Shapefile... but there is so many people that think GIS is
pronounced Arc/Info :-)

General compression sheme :

Only numbers and spaces are compressed. Linefeed are also coded, so
each line has the same lenght and you can safely ignore end of line.
Some characters must be escaped, dependant on context : numbers may
be splitted at end of line, and booth parts are coded independantly.
Only the first line is padded with blank and begin with EXP 1 instead
of EXP 0 (ascii export files)
  
Compression is done as following (at least as far as I guess) :

  Escape character is tilde : '~'

   "~~" means ~

   "~-" means -

   "~-" means E

   "~}" means LineFeed

   "~ x", where x is an ASCII char beetween '!' and (don't know max) means
        n spaces, with n = x - ' ', (so n=1 when x == '!', etc...)

   "~!" intoduce a integer (even number of digits)

   "~N" intoduce a integer (odd number of digits)

   '~' followed by '"', '(', 'O', 'P' or 'T' is for fixed decimal numbers

   "~" followed by '@', '^', '0', '1' is for float (scientific notation)

For the two last types of data, there is probably other possibilities,
because number can be split anywhere between the first digit and the
last one, but I have no examples yet... so wait for new releases...

Any other combination is copied to output without change.

Digit coding :
   Each char codes two digit, from 00 ('!') to 91 ('|')
   for 92 to 99, there is two char :  '}' followed by '!' to '('
   the number ends when a space or a tilde is encountered
   the program expects an ascii representation of chars

Note for MS-DOS users and portability consideration :

This program has been developped under Linux and should run on any unix
box...  It has been reported to work also on MS-DOS (compiled with
microsoft vc5.0), but i haven't tested extensively.

But... text file format are not the same... E00b2a can deal with any savour
(recognize both type in input) but may run in trouble if there is garbage
inside your file (like a bloc of ^Z (MS-DOS end of file) followed by normal
characters.  Since even binary e00 files use only ASCII charset, you can
edit the source with any text editor to clean it.

----
Michel Wurtz    ENGEES - Laboratoire Territoires & Environnement
                1, quai Koch - BP 1039, F-67070 STRASBOURG cedex
                mw@engees.u-strasbg.fr
