SET
Add or modify fields without affecting other fields.
Syntax
SET assignment [, assignment]* [,]?
Parameters
- assignment - Field assignment in the form
identifier = expression
Description
The SET command adds new fields or modifies existing ones while
preserving all other fields in the dataset. Unlike SELECT, which replaces
the entire field set, SET makes incremental changes to the data structure.
You can specify multiple assignments in a single SET command, separated by
commas. Each assignment creates or updates the specified field with the
result of evaluating the expression. Expressions can reference any field
available at the point where the SET command appears in the pipeline.
When the identifier already exists as a field, SET modifies that field's
values. When the identifier does not exist, SET creates a new field with
that name.
Related Commands
- SELECT - Completely redefine output fields