File Watch and Process
Watch a directory for new files, extract data, and process each row
Steps
| # | Activity | What it does |
|---|---|---|
| 1 | Watchdog | Monitor directory for new files |
| 2 | TableImport | Load the detected file into a named table on the runner |
| 3 | TableQuery | Materialise the rows for iteration |
| 4 | ForEachLoop | Process each row |
| 5 | SaveToFile | Save processed output |
Workflow
with Watchdog("./incoming", ".xlsx", newFileVariable="newFilePath"):
TableImport("incoming", newFilePath)
fileRows = TableQuery("incoming")
for row in fileRows.rows:
Assign({'processed': '{{ row.value }}'})
SaveToFile("{{ 'Processed ' + fileRows.rows.length + ' rows from ' + newFilePath }}", "./processed/output.txt")