/
Cut Character directive
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:
N
The N'th byte, character, or field, counting from 1N-
From the N'th byte, character, or field, to the end of the lineN-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:
{
"body": "one two three four five six seven eight",
"one": "one",
"two": "two",
"three": "three",
"four": "four five six seven eight",
"five": "one",
"six": "one",
"seven": "one t"
}
, multiple selections available,
Related content
Trimming Spaces directive
Trimming Spaces directive
Read with this
Set Charset directive
Set Charset directive
Read with this
Split Email directive
Split Email directive
Read with this
Directives
Directives
Read with this
Set Column directive
Set Column directive
Read with this
Text Metric directive
Text Metric directive
Read with this
Created in 2020 by Google Inc.