chunk expressions
Syntax
character <startOffset> [to <endOffset>] {of|in} <container>
word <startOffset> [to <endOffset>] {of|in} <container>
item <startOffset> [to <endOffset>] {of|in} <container>
line <startOffset> [to <endOffset>] {of|in} <container>
byte <startOffset> [to <endOffset>] {of|in} <container>
put word 2 of fullName into middleName
put "Herbert" into word 2 of line 3 of fullName
put "CENSORED" into word 3 to 4 of longSwearTirade
Explanation
A chunk expression allows you to refer to a subset of a longer value, either extracting them,
or modifying them. You can also extract a range of multiple things from a chunk, like several
lines out of a longer text, by specifying the end using the to
parameter. You can also nest
multiple chunk expressions with different chunk types.
There are 5 types of chunks:
character
Individual characters out of a longer piece of text.word
Split a bit of text at spaces and line breaks, letting you reference each word. Note that double spaces or empty lines count as a single separator.item
Split a bit of text at commas, letting you reference each “item” in that “list” separately. Note that two commas next to each other mean that an item is “empty”.line
Split a bit of text at line breaks, letting you reference each line in it separately. Note that empty lines are still counted as lines for the startOffset and endOffset.byte
A range of bytes out of a longer piece of data. Note that individual text characters may consist of several bytes, and if you only extract a single byte, you may get an invalid character. In general,byte
is intended for reading raw binary data,character
for text.