Skip to content
EXAMPLE

CSV Processing Pipeline

Summary

Wait for a complete set of files, read them into caches, combine and sort their rows, and write one controlled output file.

Files Used in This Example

Prerequisites

  • Read/write permission for the input and output directories.
  • A file-name pattern, minimum expected file count, and earliest acceptable write time.

Step 1: Watch for relevant filesystem changes

Use a directory watch as the trigger for file discovery rather than polling continuously.

=U.WATCH_FILES(C4,C5,TRUE)

Step 2: Find files only after the trigger changes

Drive the discovery formula from the watch cell and filter by pattern and time.

=U.DO(U.PAD(U.FIND_FILE(C5,C4,,,C7)),C8)

Step 3: Read and transform the ready files

Read each path, then append and sort the cached results under a descriptive key.

=IF(B22="","",U.READ_FILE(B12,,,,B22))
=U.CACHE(U.VSORT(U.VAPPEND(C22:C25)),C28)

Step 4: Gate the write on readiness

Do not create the output until the required input set exists.

=IF(C18,U.WRITE_FILE(C32,C29),"not ready")

Result

The output is written only after the readiness condition succeeds, and large intermediate data can stay in add-in memory instead of expanding the workbook.

What’s Happening

What’s happening here?

U.WATCH_FILES supplies an event-driven trigger; the readiness cell is the gate; cache keys keep intermediate datasets reusable and auditable.