Guide · CSV · Excel · Batch recovery

How can I process a CSV or Excel file and resume halfway through?

Short answer

Define one verifiable operation per row, validate the input and keep a durable record of each outcome. Ritoko reads CSV and XLSX files, freezes the rows and workflow in its SQLite journal, and resumes the same run while keeping confirmed rows and holding uncertain writes.

Updated

What should I fix in the spreadsheet before running it?

  • Use clear, unique column headers and a business key that is non-empty and unique across the batch.
  • Keep identifier columns as Text. Excel formatting is not applied: a numeric cell displayed as 07001 can read as 7001, and 15% as 0.15.
  • Export only the rows you intend to process. Hidden and filtered-out XLSX rows are still read.
  • Save calculated results in Excel. Formula errors or formulas without saved results are treated as empty when referenced.
  • Keep credentials out of input files. Declare environment-backed secret parameters instead.

Ritoko supports comma- or semicolon-separated CSV in UTF-8 or Windows-1252, plus .xlsx with a selectable sheet. It is not a general reader for every spreadsheet format. See the input reference.

How should I define the operation for each row?

Declare the input path, key, destination scope and required columns. Mark the irreversible write as commit and follow it with a check proving this row’s result. Use readOnly: true for a batch that only reads or downloads.

The entire input is validated before processing: malformed headers, duplicate or empty keys and missing referenced values are rejected. This catches input problems; it does not prove that every value is valid for the remote business system. Start with a representative small authorized batch.

Do I edit the spreadsheet to remove finished rows?

You do not need to remove finished rows to resume an existing run. The journal stores its rows and workflow definition. Resume by run ID with run_resume or CLI ritoko resume for direct execution; use host_next for host execution.

Editing the original file does not alter that saved run. Put corrected or new data into a deliberately started new batch after inspecting previous outcomes. Confirmed items remain confirmed; safe failures can retry; review items require a destination check. A new file with the same completed keys does not automatically mean a new business operation.

Which output tells me the batch is actually finished?

Use run_report or CLI ritoko report to inspect per-item status, causes, messages and available evidence or files. done means the workflow’s checks passed; skipped means already confirmed under the journal’s identity rules. A partial result still has failed or review items.

A run is complete only when its items are confirmed or skipped and its final checks pass. A partial result, stopped run or repair pause returns CLI exit code 2. Keep the journal with the installation: it is the record used for recovery, not disposable cache. Current run reports are JSON; do not assume an HTML or CSV audit report exists.

Frequently asked questions

Will changing the Excel file change a resumed run?

No. The run uses its frozen input and workflow. Start a new batch deliberately for corrected or new data, after inspecting the previous outcomes.

FOR YOUR TEAM

Which routine
would you hand over?

Tell us what you repeat, which tools you use and what a successful result looks like. We can discuss whether the workflow is a fit for Ritoko.

Tell us about your workflow