Allows to add the headers separating in fields the data of the text obtained of the HOCR document.
1 ocr.array.header
<ocr.array.header
date-pattern='date-pattern'
date-format='date-format'
number-pattern='number-pattern'
decimal-separator='decimal-separator'
grouping-separator='grouping-separator'
>
<ocr.array.header.item
type='type'
column='column'
pattern='pattern'
/> +
</ocr.array.header>
Attributes | |||||
---|---|---|---|---|---|
Name | Type | Required | Default | Description | |
Adate-pattern | String | The pattern that should have the date to be taken as date fields is defined. | |||
Adate-format | String | The date format is defined. | |||
Anumber-pattern | String | The pattern that should follow the numbers to be taken as numeric fields is defined. | |||
Adecimal-separator | String | The decimal separator is the numeric fields is defined. | |||
Agrouping-separator | String | The group separator of data is defined. |
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Eocr.array.header.item | The columns in which you want to divise the text are defined. | ||||
Atype | String | The column data type is defined. | |||
Acolumn | String | Column name. | |||
Apattern | String | Pattern that should follow the column data. |
Returns | |
---|---|
Type | Description |
Header | Added header |
Example
Gets the text through a HOCR document and it adds headers to the data of the obtained text.
Copy
<xsql-script name='ocr'> <body> <set name='m_ocr'> <ocr> <m_ocr_text /> </ocr> </set> <ocr.array.header date-pattern='(0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])[-/.](19|20)\\d\\d(?:,)' date-format='MM/DD/YYYY' number-pattern='(((\d{1,3})(.\d{3})*)|(\d+))(,\d+)?' decimal-separator=',' grouping-separator='.'> <ocr.array.header.item column='Codigo'><m_ocr/<</ocr.array.header.item> <ocr.array.header.item type='char' column='Especialidad'><m_ocr/></ocr.array.header.item> <ocr.array.header.item type='number' column='IVA'><m_ocr/></ocr.array.header.item> <ocr.array.header.item type='number' column='Cantidad'><m_ocr/></ocr.array.header.item> <ocr.array.header.item type='number' column='Precio'><m_ocr/></ocr.array.header.item> <ocr.array.header.item type='number' column='Dto.'><m_ocr/></ocr.array.header.item> <ocr.array.header.item type='number' column='Importe' pattern="(((\d{1,3})(.\d{3})*)|(\d+))(,\d+)?"><m_ocr/></ocr.array.header.item> </ocr.array.header> </body> </xsql-script>