User Guide : Using Content Extraction Language : CXL Scripts : Script Structure
 
Share this page                  
Script Structure
Every CXL script must begin with a line containing the six characters #!djrr and must contain at least one pattern-action block. A CXL script consists of a sequence of pattern-action blocks.
pattern { action statements }
These pattern-action blocks specify what to look for in an input file and the action to take when and if it is found. The patterns can contain regular expressions and comparison expressions. The actions can contain variables, fields, comments, arrays, functions, and control statements.
For output, the accept statement should be used in an action block to write data into a data file. The script can be coded to output record information as it is encountered or gather information over several input lines or the entire input document and then output it all at one time. When gathering information, arrays are useful for storing values until they are output.
Each of the items discussed above are described in more details see Language Syntax and Examples.