Next: Modification
Up: Specifying Groups of Objects
Previous: Indirection
Editing
A group expression can contain a request to edit the supplied strings
before passing them to the application. The editing facilities provided
are fairly simple. You can:
- Add a specified prefix to the start of each string.
- Add a specified suffix to the end of each string.
- Replace all occurences of a given sub-string in each string.
- Any combination of the above.
To perform this editing, you:
- Enclose the group expression specifying the strings to be edited
within curly braces (
"{" and "}"). Note, if no prefix
or suffix is supplied, and the group expression is not a comma-separated
list, then the curly braces can be omitted.
- Preceed the opening curly brace with the prefix (if any) to be added
to the start of each string.
- Follow the closing curly brace with the suffix (if any) to be added
to the end of each string.
- Append a string specifying the substitution to be performed (if any)
to the end of the whole thing. This string should be of the form
|<old>|<new>| where <old> is the text to be replaced and
<new> is the text with which to replace it. Note, the substitutions
occur before any specified prefix or suffix is added to the
strings.
For instance;
A{^file}B|my|your|
This will read strings from the text file file. Each occurence of
the string "my" will then be replaced by "your". The resulting
strings will then have "A" added at the start, and "B" added at the
end.
Next: Modification
Up: Specifying Groups of Objects
Previous: Indirection
KAPPA --- Kernel Application Package
Starlink User Note 95
Malcolm J. Currie & David S. Berry
2008 June 14
E-mail:ussc@star.rl.ac.uk
Copyright © 2008 Science and Technology Facilities Council