For the complete documentation index, see llms.txt. This page is also available as Markdown.

Cleansing options

Clean up a field's data with simple search-and-replace rules, before it is formatted and placed in the document.

Data from a supplier, a PIM or a spreadsheet is not always ready to print. It may use the wrong symbol, contain extra characters or use abbreviations.

Cleansing options fix this inside EasyCatalog, without changing your original data. Each cleansing option is a small search and replace rule: "find this, and replace it with that".

Cleansing is applied while the data is imported, before any formatting option of the field (for example, before the number or currency format).

Where to write cleansing options

Cleansing options are set for each field, in the General pane of the Field Options dialog. See The general pane.

You can write them in two ways:

  • Type them directly in the Cleansing Options text box.

  • Click the pencil icon next to Cleansing Options. This opens the Edit Cleansing Options dialog. It shows each rule in a table with two columns: Find and Change. From this dialog you can also add rules (New), change them (Edit...), remove them (Delete...), see a Preview, and Import... or Export... your rules.

Edit Cleansing Options dialog with two rules in the Find and Change columns, # changed to £ and ESY changed to EasyCatalog, and the buttons New, Edit..., Delete..., Preview, Import... and Export...
The Edit Cleansing Options dialog with two rules

How to write a cleansing option

Every cleansing option follows this pattern:

  • On the left of the =: the text to find.

  • On the right of the =: the text to replace it with.

  • At the end: a semicolon ;.

Examples

Cleansing option
What it does

#=£;

Replaces every # with £.

#=£;*=•;

Two rules at once: # becomes £ and * becomes •. Each rule ends with ;.

#=;

Removes every #. Leave the right side empty to delete a character.

ESY=EasyCatalog;

Replaces the text ESY with EasyCatalog. Rules work with words, too.

a==b=a equals b;

Replaces a=b with a equals b. See the warning below.

Exercise

Your supplier writes pcs instead of pieces, and adds an asterisk (*) to some product names. Write the cleansing options that fix both problems.

  1. Write a rule that replaces pcs with pieces.

  2. Write a rule that removes every *.

  3. Put both rules together, one after the other.

To remove a character, leave the right side of the = empty.

Show solution
  • pcs=pieces; replaces pcs with pieces.

  • *=; removes every asterisk.

Regular expressions (advanced)

A regular expression is a pattern that describes text, instead of the exact text. For example, "a paragraph mark at the end of the field". It is a powerful tool for advanced users.

To use a regular expression, start the cleansing option with REGEX::

This removes every paragraph mark (^p) at the end of the field ($): it replaces them with nothing.

To learn more about regular expressions, see Regular expression on Wikipedia.

Import and export cleansing options

If you use the same cleansing options in many fields, save them in a plain text file. Then import them whenever you need them.

To import cleansing options:

1

In the General pane, click the pencil icon next to Cleansing Options.

2

In the Edit Cleansing Options dialog, click Import....

3

Select the text file that contains your cleansing options.

To save the current cleansing options to a file, click Export... in the same dialog.

InDesign metacharacters

A metacharacter is a short code that starts with a caret (^) and stands for a special InDesign character, such as a bullet or a tab. They are the same codes used in InDesign's Find/Change dialog.

You can use them in cleansing options and in the Prefix and Suffix of the General pane. For example:

This replaces every asterisk (*) with an InDesign bullet (•).

Show the metacharacters supported by EasyCatalog
Code
Description

^#

Auto page numbering

^x

Section marker

^8

Bullet •

^^

Caret ^

^2

Copyright symbol ©

^p

End of paragraph

^n

Forced line break

^7

Paragraph symbol ¶

^r

Registered trademark symbol ®

^6

Section symbol §

^t

Tab

^\

End nested style

^y

Right indent tab

^i

Indent to here

^_

Em dash —

^m

Em space

^=

En dash –

^>

En space

^f

Flush space

^|

Hair space

^s

Nonbreaking space

^<

Thin space

^-

Discretionary hyphen

^~

Nonbreaking hyphen

^{

Double left quotation mark “

^}

Double right quotation mark ”

^[

Single left quotation mark ‘

^]

Single right quotation mark ’

^k

Discretionary line break

Last updated

Was this helpful?