Purpose, Argument, Streams, Usage, Examples, Related
┌─STRing─┐ >>──CHANGE──┬─────────┬──┤ Range ├──┼────────┼──fromstring──tostring──┬───────────┬──>< └─ANYCase─┘ └─REGexp─┘ └─maxchange─┘ Range: ┌─1-*─────────────────┐ ├──┼─────────────────────┼────────────────────────────────────────────────────────────┤ ├──columnrange────────┤ │ ┌─<───────────┐ │ └─(─┴─columnrange─┴─)─┘ Notes: (1) columnrange is unsigned.
Use the CHANGE stage to replace a character or string of characters with another character or string of characters of the same or different length. CHANGE reads records from its primary input stream, replacing any occurrences of fromstring that are found within the specified columnrange with tostring, and writes the records to its primary output stream. If fromstring does not appear in an input record, CHANGE writes the record unchanged to its secondary output stream, if it is connected, otherwise it writes the unchanged record to its primary output stream.
change /8//9/
change 383393
The following examples of the CHANGE stage command use the ANYCASE keyword and the rules
that apply for preserving the case of letters.
'pipe literal /Mack MacNeill/ | change anycase /mac/ /mc/ | console'
output:
Mck McNeill
'pipe literal /Mack MacNeill/ | change anycase /macn/ /mcn/ | console'
output:
Mack Mcneill
'pipe literal /Mack MacNeill/ | change anycase /macn/ /mcN/ | console'
output:
Mack McNeill
'pipe literal /Mack MacNeill/ | change anycase /Macn/ /mcn/ | console'
output:
Mack mcneill
'pipe literal /Mack MacNeill/ | change anycase /MacN/ /McN/ | console'
output:
Mack McNeill