Using the Facility Import/Export Utility
When you start the Facility Import/Export utility, the utility dialog box appears. Use this interface to specify parameters to export or import facility attribute .csv files, and to view the results.
See Facility Attributes CSV File for more information about the CSV files and the facility attributes they contain.
Exporting Facility Attributes
Use Export Facility Attributes to save the specified facility or current value records to a .specified csv file. If the .csv file specified already exists, it will be replaced (overwritten) when the export is run. See Viewing a Facility Attribute CSV File with Excel.
To Export Facility Attributes
- Open the Facility Import/Export utility.
- In the CygNet Facility Import/Export Utility dialog box, select a Facility or Current Value Service. Either type the service name into the text box or click ... to access the Select Service dialog box and select a Site and Service combination.
- In the Export Facility Attributes box, specify a File name to which to export the data. Either type the file name into the text box (including the .csv extension) or click … to access the Save As dialog box and browse to a directory location for the file. Browsing will insert a default file name (yoursite.service_facattrs.csv), which you can overwrite with another name if desired. Once the location and name are as desired, click Save. The directory location appears in the File text box.
Note: If you do not specify a path, the file will be created in the same directory from which the utility is run (typically CygNet\*).
- Click Export to CSV to export the file.
- When the export is complete, a message box will be displayed, showing the number of records exported, and the file location. Click OK.
- Export results are shown in the status window (bottom pane). Optionally, to clear this pane in preparation for another action, click Clear Messages. See Status Window for more information about messages displayed in this pane.
- Click Close when all export actions are complete.
Importing Facility Attributes
Use Import Facility Attributes to upload facility attribute values from a specified .csv file to the selected FAC. Before uploading the file, the utility checks each line for validity. There are also several characteristics of import files to consider before proceeding.
Considerations Before Importing a Facility Attribute CSV File
Consider the following characteristics of .csv import files before importing facility attributes.
- Required columns are site, service and id. All other columns are optional.
- Column headings are case sensitive.
- Column order is irrelevant; the utility uses the column headings to determine the data of a column.
- Omitted columns mean that the values for that attribute will not change.
- Deleted rows mean that the facility will be ignored during the import.
- Blank cells mean the value will be cleared. The exception to this is Yes/No attributes, which are ignored if the cell is cleared.
- When using the CygNet Facility Import/Export utility to import values for a table attribute, the value will be added to the table in the TRS (SYSFCTxx). If incorrect values are specified or if values are added in the wrong attribute in the .csv file, unwanted results can occur. When importing values for table-driven fields, the utility will try to resolve the values to the table’s current entries. If it is unable to resolve the value, it will add a new entry to the table. The text will be used as both the table Entry and Description. For example, you are using Table Attribute 7 for "State" and have defined the entries/descriptions as TX/Texas, NM/New Mexico, and OK/Oklahoma. However, your import file contains "Okla" as the state for one of its entries. The utility will add "Okla" as both the entry and description (Okla/Okla) since it doesn’t have an entry to which it can resolve. You will now have facilities that are in OK and Okla.
- Yes/No attributes recognize the values yes, y, or 1 to set the bit, and no, n, or 0 to clear the bit (the letters are not case sensitive).
- Cells containing the string “<ignored>” will not change the cell value when the .csv file is imported.
- Open facility records (because those records are locked) cause that facility to be skipped when the import is run.
- Exceptions — Although you can edit any item in the .csv file using the text editor, some changes will not be reflected in the FAC service after the import, due to the following potential exceptions.
- Facilities that represent devices (remote devices, comm devices, or import/export devices) — because these are DDS-owned facilities, values for the attributes SITE, SERVICE, ID, Active Flag, Description, and Category will not be changed for these facility types; those properties must be changed in the DDS.
- Facility ID edits — the ID of a Facility (id) in the .csv file is unique. If you change the Facility ID in the file, the utility will assume that the record corresponds to a new facility, and will add a facility to the service using the "new" (changed) Facility ID.
To Import Facility Attributes
- Optionally, stop the Facility Service and backup your .dat.edb file. This step is not required but is highly recommended.
- Open the Facility Import/Export utility.
- In the CygNet Facility Import/Export Utility dialog box, select a Facility or Current Value Service. Either type the service name into the text box or click ... to access the Select Service dialog box and select a Site and Service combination.
- In the Import Facility Attributes box, specify the File name containing the data to import. Either type the name of the file that contains the facility attributes into the text box (including the .csv extension) or click … to access the Open dialog box and browse to a directory location. Browsing will insert a default file name (.yourservice_facattrs.csv), which you can overwrite with another name if desired. Click Open. The directory location appears in the File text box.
- Optionally select/clear the check box to Skip line if any column exceeds max character count. If the check box is cleared, when a value in the .csv file is longer than is allowed for the attribute, the value will be truncated. If the Skip line if... check box is selected, the row will be skipped instead of truncated (the entire row is skipped, not just the value(s) that exceed the character count).
- Click Import from CSV, then Yes to verify the location, and then OK to import the file.
- When the import is complete, a message box will be displayed showing the results of the import. Click OK.
- Import results are shown in the status window (bottom pane). Optionally, to clear this pane in preparation for another action, click Clear Messages. See Status Window for more information about messages displayed in this pane.
- Click Close when all import actions are complete.
Viewing Import/Export Results
When the import/export action is complete, a box showing the number of records affected will be displayed. It shows the number of records added, updated, skipped, and an error count. "Skipped" means no updates were made because the attribute information in the .csv file matched the information in the facility record.
Viewing and Editing a Facility Attribute CSV File with Excel
The Excel default Number format is "General", which uses scientific notation for numbers of twelve or more digits. When using the Export to CSV function on the Facility Import/Export utility, opening the .csv file with Excel can cause a change of format and/or a loss of numeric characters in strings longer than twelve characters. This can cause issues if the Import from CSV function is then used to upload that .csv file to CygNet. For .csv files containing numbers of twelve or more digits, perform the following before importing .csv export files to the selected FAC.
To Reformat a CSV File Containing Numbers of Twelve or More Digits
- Open a blank Excel worksheet and select the Data tab.
- Click From Text to access the Import Text File dialog box.
- Select the facility attribute .csv file desired and click Import. The Text Import Wizard dialog box opens.
- In the Original data type section, select Delimited and click Next.
- In the Delimiters section, check Tab and Comma and click Next.
- In the Data preview area, select the numeric string column(s) to be formatted and then select Text in the Column data format section.
- Click Finish. The Import Data dialog box opens.
- Click OK.
DDS-Owned Facilities
The Facility Service (FAC) stores facilities and their attributes, however not all facilities are "owned" by the FAC service. Facilities that represent devices (remote devices, import/export devices, or communication devices) are "owned" by the Device Definition Service (DDS). All other facilities are owned by the FAC.
If a facility’s "category" attribute value is one of the following, the facility is owned by the DDS.
When using the CygNet Facility Import/Export utility (FacLoad.exe), be aware that facilities that are owned by the DDS have certain attributes that are passed to the FAC from the DDS. That means the values of these attributes must be edited in the DDS. These attributes are: site, service, id, is_active, and desc. (The category attribute is generated by the FAC service; DO NOT change it.) All other attributes are owned by the FAC. See Facility Attributes CSV File for more information about facility attributes contained in the CSV files.
When you export facility attribute values using the CygNet Facility Import/Export utility (FacLoad.exe), the .csv file will include the attributes passed to the FAC from the DDS for DDS-owned facilities. Although you can edit the values in the .csv file, they will be ignored during the import since the CygNet Facility Import/Export utility (FacLoad.exe) only changes data in the FAC. To make bulk changes to device information, use the CygNet DDS Import/Export Utility.