MetaServer > Help > Extract > Remove

120-420 MetaServer Edit – Remove

With MetaServer’s Remove rule, you can clean up your text by removing redundant spaces, tabs, line separators and empty lines, or only keep certain characters, like digits.

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 rules are defined in a MetaServer Extract or Separate Document action.

To add this rule, press the Add button and select Edit -> Remove

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 line separators: enable this option to remove line separators from your value. They will be replaced with a space.

02 – Remove tabs: choose one of these options to remove tabs preceding, between or following digits. You can also remove all occuring tabs. They will be replaced with a space.

03 – Remove spaces: choose one of these options to remove spaces preceding, between or following digits or at the beginning or end of a line. You can also combine these different options.

04 – Only keep characters: enable this option to only keep the specified characters. By default, it’s set to only keep digits.

For example:

Original value:

Operador: 321 – JCARLOSSA

After the Remove rule where you only keep the digits:


05 – Remove empty lines: removes any empty lines from your value.

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 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:



Subscribe to our Newsletter

Please enable JavaScript in your browser to complete this form.

Please check the box below to agree to the privacy policy and continue *

NOTE: if you're experiencing trouble with submitting this form, please try again using another browser.