Supported Usage Scenarios
Scenario 1: Read a file inside a folder
Let's say you have a file named 'file.txt' inside 'folder', available in your pipeline.
To read this file inside a folder, you may invoke a File Reader that indicates the path 'folder/file.txt'. That way, you can access the file 'file.txt'.
Example:
Create a pipeline and add a File Reader
Open the component settings
Define the FILE NAME as 'folder/file.txt'
Click on CONFIRM to save the component settings
Connect the trigger with File Reader
Run a test in the pipeline (CTRL + ENTER)
The result will be shown:
{
"data": [
"my sample content"
],
"fileName": "folder/file.txt",
"lineCount": 1
}
data: array with the content of the file read by File Reader
fileName: shows the complete path of the read file
lineCount: identifies the amount of lines within the file read by File Reader
Scenario 2: Write a file inside a folder
Let's say you have a file named 'file.txt' inside 'folder', available in your pipeline.
To write this file inside a folder, you may invoke a File Reader that indicates the path 'folder/file.txt'. That way, you can access the file 'file.txt'.
Example:
Create a pipeline and add a File Reader
Open the component settings
Define the FILE NAME as 'folder/file.txt'
Define the field DATA as {{ message.data }}.
Mind we're using the Double Braces expression: {{ message.data }} to access the result of the last component. In this case, we access data with the content of the file to be written.Click on CONFIRM to save the component settings
Connect the Trigger with the File Reader
Run a test in the pipeline (CTRL + ENTER)
The result will be shown:
{
"fileName": "folder/file.txt",
"success": true
}
fileName: shows the complete path of the written file
success: when the result is true, it indicates that the execution was successful
Lots of other components have the features above:
Read and Write files
File Reader
File Writer
CSV File Writer
CSV to Excel
Excel
Stream Excel
Stream File Reader V2
Upload, Download and Data Storage Files Delete
Digibee Storage
S3 Storage
Google Storage
Dropbox
SFTP
FTP
One Drive
WebDAV
Other components
WGet
Zip File
REST V2
PGP