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.
CSV file location on the localhost after uload
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).
1
> tag @files:loadfile
2
@files:loadfile>
3
@files:loadfile> data filename = '/root/notebooks/incidents.csv'
Copied!
RDA will load the file incidents.csv via terminal and displays above UI
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.
1
@files:loadfile> data filename = '/root/notebooks/incidents.csv' --> @dm:save name = 'incidents-summary'
Copied!
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.
1
tag *dm:savedlist
2
*dm:savedlist> data
Copied!
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.
Above screenshot displays 'incident-summry' dataset that is stored
Now run the following code snippet to store the dataset into JSON format.
1
tag @dm:recall
2
@dm:recall> data name = 'incidents-summary' --> @files:savefile filename = '/root/notebooks/incidents.json'
Copied!
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).
Above screenshot disaplays the file location and the JSON format that was stored
Last modified 4mo ago
Copy link