Importing Records into SpotLog

It is possible to import records into SpotLog using the Android version of the app: the current iOS version does not have an import function.  It is expected the next version of SpotLog will have full export and import functions on both platforms.

For the time being, if you have the iOS version of SpotLog and you need to import records the way to achieve it is to use an Android phone to import the data and then sync the records to the iPhone.  If this is a problem, then please contact SpotLog support (or via the forum) for assistance.

 

Import on SpotLog Android

To import data on SpotLog (Android) you need the data in an XML format (this is similar to the file format used for the sync service).  The file should be a plain text file with the SpotLog XML header:

<?xml version="1.0" encoding="utf-8"?>
<spotlog version="v4.14">
  <records>
    <record number="59001" date="2018-05-03 19:59:31"  photo="1"/>
    <record number="59002" date="2018-05-03 19:59:33"  haul="1"/>
    <record number="66025" date="2018-05-03 20:46:05" />
    <record number="25025" date="2018-05-12 09:16:47" />
    <record number="47035" date="2018-05-12 09:16:53"  photo="1"/>
    <record number="66099" date="2018-05-12 09:16:57"  haul="1"/>
    <record number="652" date="1993-04-15 12:00" location="Grosmont" note="Grosmont to Pickering" haul="1"/>
    <record number="33028" date="2018-04-29 15:41:51" />
    <record number="37248" date="2016-07-29 10:09:34"  location="GWR" note="D6948" photo="1" haul="1" />
    <record number="26043" date="2016-07-29 10:22:35"  location="GWR" note="D5343 dh D5081" photo="1" haul="1" />
    <record number="45149" date="2016-07-29 10:43:42" location="GWR" photo="1" note="" hold="0"/>
    <record number="51405" date="2016-07-29 11:41:03"  location="GWR" photo="1" note="" />
    <record number="450 033-6" location="Basle Bad" date="2018-05-26 12:00:19" note="" lat="null" lon="null" photo="0" haul="0" hold="0" />
    <record number="460 054-0" location="Basle Bad" date="2018-05-26 12:00:32" note="" />
  </records>
</spotlog>

Points to note about file format:

  • Opening tags "spotlog" and "records" MUST be matched by closing tags </spotlog> and </records>
  • Tag names "spotlog", "records", "record" are case-sensitive
  • Each "record" element must be closed with "/>"
  • Attribute names ("number", "date", "location" etc) are case sensitive
  • Indentation does not matter (above is just the usual way xml is indented to make it easier to read)

You can find an example file here

Create the XML file with one record row for each record you want to import.

The following attributes can be imported are available (note case sensitive):

number required The loco/unit/coach number as recorded  
note optional any note for the record  
location optional record location  
photo optional 0/1 only need if "1", if omitted, default is 0
haul optional 0/1 only need if "1", if omitted, default is 0
hold optional 0/1 only need if "1", if omitted, default is 0
date optional but recommended! date in format YYYY-mm-dd hh:MM:ss  

All fields, except "number", are optional and can be omitted.  Fields "photo", "haul","hold" are generally only included if those values need to be set (ie value =1) if omitted the field is not set on import.

Note that the XML format is sensitive to errors including missing closing tags, missing quotes etc.  Once you have created your file, it is a good idea to check the file for a valid format.  A simple way to do this is to open the file using Chrome browser: Chrome will display the file contents, or an error message if the format/structure is invalid. 

You may find it helpful to start by importing a small number of records first, and then once successful with that, move on to a bulk import.

Import on Android device

  • Copy your xml import file to the Android device (hint: use the downloads folder or the SpotLog folder).
  • Open SpotLog
  • From the menu, select the "Data" sub-menu and then "Import"
  • Browse to the location you saved the file, and select the import file.

SpotLog will then import the data - this may take some time if you are trying to import a lot of records - and SpotLog may display an error message if there are problems during the import.

Once the import has completed, the imported records will be found in the Notepad section.

 

You now need to run the matching process for SpotLog to identify the records, mark them in the book and move the records to the log.  On Android, select "Process" from the menu and wait while SpotLog processes the records.

Any ambiguous records will remain in the notepad and you will need to use the normal processes to dis-ambiguate.

Note, that if you are planning on syncing the data to iPhone, the processing can be done before the sync, or afterwards on either device.

Syncing Data to iPhone

See Syncing

Once you have imported the data, you can use sync to transfer the data to another device (eg iPhone).  Follow the normal sync process as on the above link.

 

 

 

Contents