User Tools

Site Tools


perseus:user:activities:matrixprocessing:rearrange:processtextcolumns

Process text column

General

Brief description

Values in string columns can be manipulated according to a regular expression.

Parameters

Columns

Selected text columns, whose values should be manipulated by the defined regular expression (default: no columns are selected).

Regular expression

Specified regular expression that is applied to the selected text columns (default: “^([^;]+)”). A regular expression is a sequence of characters that forms a search pattern with a special syntax. A good general introduction can be found, as always, on Wikipedia: http://en.wikipedia.org/wiki/Regular_expression. If you already know generally how regular expressions work, you may only need to glance at a Quick Reference or at an even quicker Cheat Sheet.

Here are a few examples.

Regular expression Effect
^([^;]+) Select all the characters from the beginning of the line, up to but not including the first semicolon. This is the default.
TAG *= *([^,; ]*) Look for the first instance of “TAG = ”, with any amount of whitespace (or none) around the equal sign, and return what follows after the whitespace until a comma or semicolon is reached.
([ACTG]+) return the first string consisting only of the letters A, C, T, and G.
(20[01][0-9]-[01][0-9]-[0-3][0-9]) Select a date between 2000 and 2019 of the form 2014-08-19.

Replacement string

You can provide a replacement string here for more flexibility. Leave empty if unsure.

Examples

Replacement Effect
$1 Replace the original string with the first capture group, i.e. the part of the original string inside the first parentheses (..).

Keep original columns

If checked, the original columns are retained unchanged, and new columns are appended to hold the results (default: unchecked). The name of a new column is created by appending underscores to the name of the original column until it is unique. If this box is not checked, then the strings in the original columns are overwritten by the results.

Strings separated by semicolons are independent

If checked, each string is split into substrings at the semicolons, and the regular expression is applied independently to each substring (default: unchecked). The results are separated by semicolons and concatenated into a single string, which is returned. This is useful for columns where any row may contain multiple entries. If not checked, the string is evaluated as a whole and the only first match returned.


Parameter window

Perseus pop-up window: Rearrange -> Process text column

perseus/user/activities/matrixprocessing/rearrange/processtextcolumns.txt · Last modified: 2017/07/12 11:24 by rudolph