Skip to main content

File Watch and Process

Watch a directory for new files, extract data, and process each row

Steps

#ActivityWhat it does
1WatchdogMonitor directory for new files
2TableImportLoad the detected file into a named table on the runner
3TableQueryMaterialise the rows for iteration
4ForEachLoopProcess each row
5SaveToFileSave 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")