Document Files
5 nodes
On this page 5
Read Document Paragraphs
FunctionA .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.
ReadDocumentParagraphs(path: Text, skipEmpty: Truth) -> Table
Table ReadDocumentParagraphs(string path, bool skipEmpty = true)
Parameters
| name | type | default | description |
|---|---|---|---|
| path | Text | — | The document (.docx). |
| skipEmpty | Truth | True | Whether to leave out empty paragraphs, the blank lines between the others. |
Returns
| Paragraphs | Table |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Document Files
- Package
- Data Analytics
Read Document Table
FunctionOne 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.
ReadDocumentTable -> Table
path: Text
number: Integer
header: TruthTable ReadDocumentTable(
string path,
int number = 1,
bool header = true)Parameters
| name | type | default | description |
|---|---|---|---|
| path | Text | — | The document (.docx). |
| number | Integer | 1 | Which table, counting from 1 in the order the document has them. |
| header | Truth | True | Whether the table's first row holds its column names. |
Returns
| Table | Table |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Document Files
- Package
- Data Analytics
Read Document Tables
FunctionEvery 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.
ReadDocumentTables(path: Text, header: Truth) -> Table Array
Table[] ReadDocumentTables(string path, bool header = true)
Parameters
| name | type | default | description |
|---|---|---|---|
| path | Text | — | The document (.docx). |
| header | Truth | True | Whether each table's first row holds its column names. |
Returns
| Tables | Table Array |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Document Files
- Package
- Data Analytics
Read Document Text
FunctionA .docx document's text: a line for each paragraph, and for each row of a table its cells apart by tabs.
ReadDocumentText(path: Text) -> Text
string ReadDocumentText(string path)
Parameters
| name | type | default | description |
|---|---|---|---|
| path | Text | — | The document (.docx). |
Returns
| Text | Text |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Document Files
- Package
- Data Analytics
Write Document
FunctionWrites 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.
WriteDocument -> Text
path: Text
title: Text
paragraphs: Text Array
tables: Table Arraystring WriteDocument(
string path,
string title = "",
string[] paragraphs,
Table[] tables)Parameters
| name | type | default | description |
|---|---|---|---|
| path | Text | — | The document to write (.docx); its folder is created if need be. |
| title | Text | — | The document's title; none when empty. |
| paragraphs | Text Array | — | The paragraphs, in order; optional. |
| tables | Table Array | — | Tables to write after the paragraphs, in order; optional. |
Returns
| Path | Text |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Document Files
- Package
- Data Analytics