Using JMRI® to Operate Trains
OperationsPro: Import Locomotives from a File
Import locomotives from file
Choosing Import locomotives from file from the Locomotives -> Tools menu opens a system Open dialog box to allow you to select the file of your choice. It requires an ASCII text file, with one line for each Locomotive (Engine). The import order is:
- Locomotive Number
- Locomotive Road Name
- Locomotive Model
- 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
The Location can have two fields: the Location Name followed by the Location's Track Name, separated by a hyphen "-". The following shows two example records in 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 records to import using comma as delimiters.
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 delimited 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 a Locomotive already exists, the import of that record 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 them to add missing attributes.
These Locomotives were imported from your file, so now we will need to edit them to set missing attributes that are required in OperationsPro: Length, Consist, Location as required. The Edit button in the Edit column will open the Edit Locomotive window and allow you to edit Locomotive attributes.
The Set button in the Set column for each Locomotive in the Roster allows you to set the Location.