Cut Character directive

The CUT-CHARACTER directive selects parts of a string value, accepting standard cut options.

Syntax

cut-character :source :destination <type> <range|indexes>

The <type> <range|indexes> are the standard cut options.

Usage Notes

The standard options for the CUT-CHARACTER directive include a list of one or more ranges of characters. Each range is prefaced with a type (-b byte, -c character, -f field) and written as:

  • The N'th byte, character, or field, counting from 1

  • N- From the N'th byte, character, or field, to the end of the line

  • N-M From the N'th to M'th (included) byte, character, or field

  • -M From the first to M'th (included) byte, character, or field

Example

Using this record as an example:

{ "body": "one two three four five six seven eight" }

Applying these directives:

cut-character :body one -c 1-3 cut-character :body two -c 5-7 cut-character :body three -c 9-13 cut-character :body four -c 15- cut-character :body five -c 1,2,3 cut-character :body six -c -3 cut-character :body seven -c 1,2,3-5

results in this record:

 

Created in 2020 by Google Inc.