cfxdm - files:loadfile

Manage files: Loading a file into AIOps studio

@files:loadfile: It allows users to upload CSV/XLSX/JSON files into AIOps studio for further processing or analysis.

@files:loadfile: syntax (parameters)

  • filename: Mandatory parameter. Enter the filename with path or URL location of the file

  • filetype: Optional parameter. File type is either csv/json/xlsx. If not specified, it will be derived from the extension.

  • sheet: Optional parameter. Specify sheet name if the file type is xlsx. If not specified, the first sheet will be returned.

The files need to be uploaded to ~/cfx/cfxdx/home/notebooks folder from which it can be read and loaded into AIOPs studio using @files:loadfile tag.

Download the incidents.csv file to the local machine as shown below using a standard web browser. Users can transfer the above dowloaded file to RDA installed machine using standard SFTP/SCP/FTP tools.

Once the file is uploaded to RDA machine under above explained location, users can load and perform other operations with 'incidents.csv' file (as explained below).

> tag @files:loadfile
@files:loadfile> 
@files:loadfile> data filename = '/root/notebooks/incidents.csv'

Below explained tag helps users to save the loaded CSV/XLSX file(s) data into a dataset which can be re-used when needed within the AIOps studio using terminal.

@files:loadfile> data filename = '/root/notebooks/incidents.csv' --> @dm:save name = 'incidents-summary'

In addition loading CSV files, RDA supports JSON files (format in JSON) as well. Following example shows how to store the above loaded incidents file in CSV format to JSON format.

tag *dm:savedlist
*dm:savedlist> data

Once users execute the above code using RDA terminal, RDA will print all the stored datasets (including the above stored 'incidents-summary' dataset that was loaded from CSV file.

Once the data is stored in dataset, users can save the dataset into JSON file as shown in the following screenshot.

Now run the following code snippet to store the dataset into JSON format.

tag @dm:recall
@dm:recall> data name = 'incidents-summary' --> @files:savefile filename = '/root/notebooks/incidents.json'

Once a user runs the above snippet, the dataset data is stored in JSON file and stored on the file system as mentioned in the above location (shown in the following screenshot).

Last updated