CSV Export and Import Features by G4EML

Contents:
  1. Description
  2. Menu Functions
  3. Typical workflows
  4. CSV Files

[Top][Home]

Description

Managing large codeplugs for DMR radios can be difficult using the CPS. The CSV export and Import feature enables major edits and modifications to be made using a spreadsheet program such as Microsoft Excel or LibreOffice Calc. Using spreadsheet programs allows the use of their powerful editing facilities such as Copy and paste, sorting, find and replace, automatic number incrementing, etc.

A codeplug contains several different types of data. Some items such as the users DMR ID are only entered in one place, other items consist of large tables of entries.

The CSV functions only addresses the five main lists:-

The Export function extracts the data for the 5 lists from the curently open codeplug and saves that data in 5 separate files. Contacts.csv, TG_Lists.csv, Channels.csv, Zones.csv and DTMF.csv.

The format of these files is CSV or comma separated variables. This type of file can be opened and modified using any spreadsheet program. The 5 files are expected to be contained in a single folder.

Because the five different lists cross refer to each other it is important to keep all five files together and synchronized. For example if you rename a channel in the Channels.csv file then you must also rename it in the Zones.csv file.

Once the files have been modified using a spreadsheet they should be saved back as .csv files. The Import function can then be used to import those modified files back into the currently open codeplug which can then be loaded into the radio.

The CSV functions are found in the File / CSV sub menu.
Export to CSV

Displays a dialogue asking for a folder in which to save the .csv files. It is recommended that the five files are saved into their own folder. This can be an existing one or you can create a new one. The folder should be named to indicate the contents of the .csv files. Once you have selected the folder the five .csv files will be created in that folder. A summary of the file contents will be displayed.gt

The exact format of the CSV files will be determined by the regional setting of your computer. The decimal separator will be either a full-stop (period) e.g. 145.525 or a comma e.g. 145,525 The Field separator will be either a comma , or a semi colon.;

Import from CSV

Displays a dialogue asking for the folder containing the .csv files. Once you have selected the folder the files will be read and inserted into the currently open codeplug.

Important note:- Any existing contacts, TG Lists, Channels, Zones and DTMF Lists will be deleted and replaced with the ones from the .csv files. This is the recommended way of sorting and reloading existing codeplugs. After loading a summary of the new codeplug contents will be displayed.

Append from CSV

Displays a dialogue asking for the folder containing the .csv files. Once you have selected the folder the files will be read and appended to the currently loaded codeplug.

Important note:- If the name of an entry in any of the .csv files is the same as an existing entry in the codeplug then the codeplug entry will be overwritten with the new data. If the name of an entry in the .csv file is unique then it will be appended to the end of the codeplug. Matching is done using the name of an item and not the data. So it is possible to end up with, for example, two channels with identical settings but different names. After the appending process has completed a summary of the new codeplug contents will be displayed. This should reflect any changes in the number of items.

Typical workflows

To rearrange an existing codeplug:-

To rearrange an existing codeplug:- Using the CPS:-
gt Download the codeplug from the radio.
Save the Codeplug as a .g77 file as a backup.

File --> CSV --> Export to CSV

Using a spreadsheet program such as Excel:-
Open each .csv file and edit, rearrange, modify as required. Re-save as .csv files.

Using the CPS:-
Open the saved codeplug.gt
File --> CSV --> Import from CSV.
Save the new codeplug with new name.

Check the changes have been made correctly. Download the codeplug to the radio.

To append new channels from .csv files to an existing codeplug:-

Note:- this method is the fastest but will result in existing channels being renumbered. If the actual channel numbers are important (for quick access in the ‘All Channels’ zone) then you need to use the previous method to manually combine .csv files and assign channel numbers to suit.

Using the CPS:-
Download the codeplug from the radio.
Save the Codeplug as a .g77 file as a backup.
File -> Csv -> Append from CSV
Save the updated Codeplug with a new name.

Check the additions have been made correctly.
Download the codeplug to the radio.

CSV Files

Each .csv file can be opened with a spreadsheet program. Normally there will be a dialogue before opening the file. Ensure that the separator or delimiter option is set correctly to semi-colon or comma to suit your file. This will ensure that the entries are correctly assigned to columns in the spreadsheet.

When saving the files after editing make sure that they are saved in .csv format and not the normal spreadsheet format.

When modifying the file it is important to ensure that the columns remain in the same order. For example when creating a new channel it is easiest if you copy the entire line of an existing channel and then paste it as the new channel. Then edit the contents of that new channel. This ensures that all columns contain valid data. Each cell of the spreadsheet can contain a number or text depending on their use. It is important that the text used in some columns is exactly correct including captalisation. For example ‘No’ is not the same as ‘no’. For this reason it is best to copy and paste from another cell with a similar setting. Valid values are listed below.

You may find that some entries are preceded by a Tab character, this is used when a column contains numbers and may be interpreted incorrectly by the spreadsheet program. Adding a leading Tab forces the field to be treated as a string. The extra character is removed when re-imported into the utility.

Contacts.csv
The first line is the Header line and should not be changed.

The 4 Columns are as follows:-
TG_Lists.csv
The first line is the Header line and should not be changed.

The 33 Columns are as follows:-

Contacts are text entries for each member of the TG List. These names must match exactly the names defined in contacts.csv. A maximum of 32 entries. They can be left blank if not needed.

Zones.csv
The first line is the Header line and should not be changed.

The 81 Columns are as follows:- Channels are channel names for each member of this zone.
These names must match exactly the names defined in channels.csv.
Channels.csv
The first line is the Header line and should not be changed.

The 24 Columns are as follows:-
DTMF.csv
The first line is the Header line and should not be changed.

The 2 Columns are as follows:-
APRS.csv

The first line is the Header line and should not be changed.

The 2 Columns are as follows:-

Glenn Lyons VK4PK
glenn@LyonsComputer.com.au
Ver:gnl20251016 - pre published v0.9