Custom Report Writer: Formatting Options

Formatting Options:

Adding Tabs

Tabs can be added to the output by adding \t

Using Regular Expressions

Regular expressions can be added to any argument by adding the .regex to the end of the defined argument. For example, if the 050$a has been added as an argument, you would initialize the regular expression option by using {050$a}.regex.

The .regex function options are:

  • pattern — the data to find
  • output — output data

So, if I wanted to extract just the LC classification values from a call number like G4292 — you would use a regular expression like:

{050$a}.regex(“([^0-9]*)(.*)”,”$1″)

Setting page length

If you need to set a specific number of lines, you can use the mnemonic: {lines} and the function .pad. So, setting a page size to 11 lines, it would look like this:

{lines}.pad(11)