Importing and Exporting

 

 

 

images\ebx_1259814661.gif

There are 3 ways of getting data out of the program.  

1) Scattered on various forms throughout the program you will see a button that looks like this: images\ebx_242579661.gif  Anywhere you see that button, you will also be looking at a list of records.  Pressing that button will allow you to send the displayed list directly into Excel as a spreadsheet.   If you do not have Excel, the program will instead automatically save the file as a tab-delimited text file and place it in with the same folder as the program.

2) Previewing any report will allow you to save that report into either a pdf, rtf, or Excel spreadsheet.

3) The import/export form.

This feature allows you to export the records in your database to a flat ascii text file.  You can also import such a file as well.  Thus if you have old records from a previous database, if you can get them into the format specified, then the program will import those records.  This is particularly useful when you already have some 500 pieces of rolling stock already databased!

NOTE!  Do not use this feature to back up your records.  Not all data related to your records gets exported.

From the main screen go to the Administration section.  At the top you will see a button "Import/Export Layout data".  Pressing this button and you will get:

images\ebx_-1538598280.gif

From here you can import and export the data in this database.  Please note the big warning message.  MCS holds no liability should you incorrectly import data and corrupt the database.  Hence, back up your database!

Note at the top left is the option of the format you wish to export your files in.  You can choose fixed length (not recommended), or delimited.  Tab delimited files are the most popular and easily import into Excel spreadsheets and most common databases also support this file format.

For fixed length you will need to know the field sizes.  The tab Import Specification has that information displayed.  You can export this specification to a text file too if you wish.  MCS hopes that this will become a standard import/export specification regardless of the shipment software you use.  That said, it's MCS's position that tab delimited text files be the norm, not fixed length text files.  (XML is also a popular new date file format.  This will not be available at this time, besides, it's very unlikely the average modeler will need such a sophisticated file format.)

Also note that not all data is exported.  Only the basic layout data is exported.  Passenger consists and scheduling of trains and meets is not exported.  Thus do not use exporting of files as a database backup method.  The database is more easily backed up as the file it is, MRDB.MDB, and placed somewhere safe, such as a CD, or tape backup.  The exporting of files is only for taking your basic layout data to be used elsewhere.

The right set of options allows you to export whatever items of your database you wish to.  Simply check each one. Exporting is easy, press the "Export Data to Files" button.  The files will be located in what ever folder you choose. The Import Progress tab will show what was exported.


images\ebx_-940520447.gif

Importation is another matter altogether.  Before you import any data make sure the database is backed up.  You'll see that option. Pressing the "Import Data from Files" you will be given the option of finding the files to import.  You'll see the Import Progress tab fill with what the program did to import the files.

Before you import a file, you can check to see if it conforms to what the program expects.


images\ebx_451793357.gif

You can go to any cell and change the contents.  Make sure all the field values line up and are correct.  When your ready press Save File.  Once you are sure the files are all correct, you can do the actual import.

Once you import the records, you get another chance to change things.  The View/Edit Imported Records gives you the option of viewing what was imported and change any errors.

The last tab is the import/export specification.

images\ebx_1424294617.gif

This specification has a number of main parts.  What entities are to be exported (Industries, shipments, rolling stock, etc.), the fields, their data types and the field sizes and the purpose of the field.

Again, MCS does not guarantee that records imported will continue to let the program run correctly, it all depends upon the data itself.

Eventually there will be a fourth method for getting data out.  An ActiveX dll will be created which will allow your own programs to extract data from the database.