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