The JMRI Manual
Download 3.0
Installing JMRI
Starting JMRI Operations
Using JMRI Operations

Using JMRI® to Operate Trains

Import Locomotives from a File


Back to Index

Import locomotives from a File

The import from file function requires an ACSII text file, with one line for each locomotive. The import order is locomotive number, locomotive road name, locomotive model, and locomotive length. The following shows two examples of the correct format:

236 UP RS4 40
5578 SP SW1200 42

Each line can start with a space and multiple spaces between fields is okay. Optionally you can include additional information in the following order, owner name, date built, and location. The location can have two fields, the location name followed by the location's siding or yard name separated by a hyphen. The following shows two examples of the correct format:

236 UP RS4 40 AT 1930 Home Town USA - locomotive Terminal
5578 SP SW1200 42 DB 1934 York - York locomotive Yard

If you prefer to use comma delimiters instead of spaces, place the word "comma" at the start of your import file and use commas instead of spaces. The following are two examples of importing locomotives with comma deliminters.

236,UP,RS 4,40,AT,1930,Home Town USA,-,locomotive Terminal
5578,SP,SW 1200,42,DB,1934,Town of York,-,York locomotive Yard

You need to be very careful with spaces when importing a comma delimitated file. The program will include leading and trailing spaces if they exist between the commas.

Note that the program will only add locomotives that don't exist in the program's locomotive roster. If the locomotive already exists, it will be skipped by the program.

After importing your locomotives, you must save them if you want to keep them as part of your roster then edit themto add missing attributes.

engine roster

These engines were imported from your file, so we will need to edit them to set missing attribute that are required: Length , Consist, Location as required.
Edit button in the Edit column will open the Edit Locomotives window and allow you to edit locomotive attributes..

Set button in the Set column for each locomotive in the roster will allow you to set the location.


Back to Index