Divooka Reference

Document Files

5 nodes

On this page 5

Read Document Paragraphs

Function

A .docx document's paragraphs, in order, as a table: Level (a heading's level from 1, missing for body text), Style (the style the paragraph is set in) and Text. Only the body is read - not the page's header and footer, footnotes or comments - and a paragraph inside a table is left to Read Document Tables.

Signature
ReadDocumentParagraphs(path: Text, skipEmpty: Truth) -> Table
Table ReadDocumentParagraphs(string path, bool skipEmpty = true)

Parameters

nametypedefaultdescription
pathText—The document (.docx).
skipEmptyTruthTrueWhether to leave out empty paragraphs, the blank lines between the others.

Returns

ParagraphsTable
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Document Files
Package
Data Analytics

Read Document Table

Function

One table of a .docx document, by its number from 1, as a table named Table 1, Table 2 and on - read as Read Document Tables reads each.

Signature
ReadDocumentTable -> Table
    path: Text
    number: Integer
    header: Truth
Table ReadDocumentTable(
    string path,
    int number = 1,
    bool header = true)

Parameters

nametypedefaultdescription
pathText—The document (.docx).
numberInteger1Which table, counting from 1 in the order the document has them.
headerTruthTrueWhether the table's first row holds its column names.

Returns

TableTable
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Document Files
Package
Data Analytics

Read Document Tables

Function

Every table in a .docx document, in order, each as a table named Table 1, Table 2 and on. A column whose cells all read as numbers is numbers, as dates dates, and otherwise text; a cell merged across columns is read in the first of them.

Signature
ReadDocumentTables(path: Text, header: Truth) -> Table Array
Table[] ReadDocumentTables(string path, bool header = true)

Parameters

nametypedefaultdescription
pathText—The document (.docx).
headerTruthTrueWhether each table's first row holds its column names.

Returns

TablesTable Array
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Document Files
Package
Data Analytics

Read Document Text

Function

A .docx document's text: a line for each paragraph, and for each row of a table its cells apart by tabs.

Signature
ReadDocumentText(path: Text) -> Text
string ReadDocumentText(string path)

Parameters

nametypedefaultdescription
pathText—The document (.docx).

Returns

TextText
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Document Files
Package
Data Analytics

Write Document

Function

Writes a .docx document and gives back its path: the title at the top when there is one, then each paragraph, then each table under its name in bold, with a header row repeated on every page it runs onto. Every row of each table is written.

Signature
WriteDocument -> Text
    path: Text
    title: Text
    paragraphs: Text Array
    tables: Table Array
string WriteDocument(
    string path,
    string title = "",
    string[] paragraphs,
    Table[] tables)

Parameters

nametypedefaultdescription
pathText—The document to write (.docx); its folder is created if need be.
titleText—The document's title; none when empty.
paragraphsText Array—The paragraphs, in order; optional.
tablesTable Array—Tables to write after the paragraphs, in order; optional.

Returns

PathText
Ships with
Divooka ExploreDivooka Compute
Graph kinds
Flows Function Events Routine Constructs StateMachineState
Declared by
Document Files
Package
Data Analytics