For the complete documentation index, see llms.txt. This page is also available as Markdown.

Split Document

How it works

$ npm run start -- split-document -h
Usage: robosaur split-document [options] <configFile>

Split document into multiple projects

Options:
  -h, --help  display help for command

Robosaur can split a file based on the configuration. The split behavior can be configured using:

  • linesPerFile: Number of lines in each split file.

  • filesPerFolder: Number of files in each output folder.

Unlike other commands, datasaur and projectState are not required for this command because it does not make any API calls. As a result, the configuration for this command only requires the splitDocument attribute.

Configuration

{
  "splitDocument": {
    "path": "<path-to-a-file-that-will-be-split>",
    "header": true,
    "linesPerFile": 100,
    "filesPerFolder": 10,
    "resultFolder": "<path-to-all-split-files-result>"
  }
}

Path

path specifies the file to split. Currently, Robosaur only supports files stored locally on your device.

Result folder

resultFolder specifies where the split files will be saved. Currently, Robosaur only supports saving results to a local directory on your device.

The result will be compatible with project creation input. The result folder will be created if it doesn't exist and will be emptied if it already exists.

header defines whether the CSV file contains a header row.

Files per folder

filesPerFolder defines how many split files are placed in each folder. This setting helps make the output compatible with the create-projects command.

  • Each folder is treated as a project.

  • Each file inside a folder is treated as a document.

Lines per file

linesPerFile defines how many lines each split file contains before Robosaur creates the next file.

Last updated