Extract CNPJ
Verb: extractCnpj
Available from: <Enterprise>
Extracts CNPJs from plain text according to Language.
Syntax
extractCnpj --culture(Culture) --text(String) (List<String>)=values (String)=first (DataTable)=valuesmapping (Boolean)=success
Inputs
Script | Designer | Required | AcceptedTypes | Description |
---|---|---|---|---|
--culture | Language | Required | Culture | Language in which the defined text is written. Options:
The punctuation pattern changes according to the set language. |
--text | Text | Required | Text | Text from which to extract the CNPJ. |
Outputs
Script | Designer | AcceptedTypes | Description |
---|---|---|---|
values | Values | List<Text> | List of CNPJs extracted from text defined in Text |
first | First value | Text | First CNPJ extracted from the text defined in Text. |
valuesmapping | Values mapping | Data Table | Data table with parameter CNPJs Values. |
success | Success | Boolean | True, it was successful in extracting; if not, returns False. |
Example
Set Language to English (United States) to extract CNPJs from alleged clients.
defVar --name cnpjsText --type String --value "Customer 1, CNPJ: 65.602.445/0001-97\r\nCustomer 2, CNPJ: 71.634.611/0001-30\r\nCustomer 3, CNPJ: 53.105.504/0001-32"
defVar --name cnpjsList --type List --innertype String
defVar --name firstValue --type String
defVar --name success --type Boolean
extractCnpj --culture en-US --text "${cnpjsText}" cnpjsList=values firstValue=first success=success
logMessage --message "CNPJs List: ${cnpjsList}\r\nFirst CNPJ found: ${firstValue}\r\nSuccess: ${success}" --type "Info"
// Result:
// CNPJs List: [65.602.445/0001-97,71.634.611/0001-30,53.105.504/0001-32]
// First CNPJ found: 65.602.445/0001-97
// Success: True
Remarks
CNPJ is an identification number of brazilian companies. Can also be called National Register of Legal Entities. It would be the equivalent of a Registration Number (RN) in the US.