Let’s create a rule called IDBasedRule for a file with the extension TXT.

Step1: Create rule name and examine file contents

  1. Select Options from the Tools menu and select ezParse from the list displayed on the screen.

  2. From the File Groups list control, select Text Based Files.  Select TXT from the File Extension list, then select Add from the Rules section of this dialog panel . Type IDBasedRule when requested to do so and then press OK.

  3. Now that you’ve created a Rule called IDBasedRule, highlight this with the mouse and select Edit Rule.

ezp002.bmp

  1. In the Preview section, use the browse button and locate the file idbasedfiles.txt. Press the Preview button to display the contents of the file in the File Preview window.

This file have translatable text enclosed between double-quote characters. In addition to this it has an ID at the start of each line that uniquely identifies each string. We shall create a rule that not only extracts this translatable text but also uses the ID.

Step 2: Create methods for text and IDs

  1. In the Methods section, enter the following Regular Expressions in the Start Tag and End Tag fields.

ezp004.bmp

  1. Hit the Preview button to see the results of this method . Notice that the text has been extracted correctly along with the ID that uniquely identifies it.

ezp005.bmp

The ezParse rule is not complete and this can now be used to extract text and ids from any file with a similar format.