120-420 MetaServer Edit – Remove Spaces
With MetaServer’s Remove Spaces rule, you can clean up your text by removing redundant spaces.
This rule can be useful for making it easier to find the required data in the text. It’s frequently combined with Find Word Group, Find Word or Find Line rules.
In our example, we will make use of the “CB – CUPOM FISCAL” workflow. This workflow is automatically installed with CaptureBites MetaServer.
Remove Spaces rules are defined in a MetaServer Extract or Separate Document action.
To add this rule, press the Add button and select Edit -> Remove Spaces
After extracting the text containing the CNPJ number and cleaning it up with a Replace Text rule, we want to remove spaces between digits to make sure that the CNPJ number has a consistent CNPJ format. This way, it can be found with a Find Word with Type rule later.
First, add a description to your rule. Then, select a field that holds your text. In this case, we select the field “CNPJ”.
01 – Remove spaces: choose one of these options to remove spaces preceding, between or following digits. You can also combine these three different options.
TIP: you can copy the current settings and paste them in another setup window of the same type. Do this by pressing the Settings button in the bottom left of the Setup window and by selecting Copy. Then open another setup window of the same type and select Paste.
- Extracting the full text (the CNPJ number is extracted as “03 005 347000115”)
- Cleaning up the text using a Replace Text rule
- Using a Remove Spaces rule (spaces between digits) to format the CNPJ number in the text consistently (the CNPJ number in the text is converted to “03005347000115”)
- Using a Find Word with Type to find a valid CNPJ number
we get the following result: