Mercurial > repos > bgruening > text_processing
diff replace_text_in_column.xml @ 7:d64eace4f9f3 draft
Uploaded
author | bgruening |
---|---|
date | Sat, 17 Jan 2015 08:30:15 -0500 |
parents | 8928e6d1e7ba |
children | c78b1767db2b |
line wrap: on
line diff
--- a/replace_text_in_column.xml Thu Jan 08 09:07:31 2015 -0500 +++ b/replace_text_in_column.xml Sat Jan 17 08:30:15 2015 -0500 @@ -21,7 +21,7 @@ <param format="tabular" name="infile" type="data" label="File to process" /> <param name="column" label="in column" type="data_column" data_ref="infile" accept_default="true" /> - <param name="find_pattern" type="text" size="20" label="Find pattern" help="Use simple text, or a valid regular expression (without backslashes // ) " > + <param name="find_pattern" type="text" size="20" label="Find pattern" help="Use simple text, or a valid regular expression (without backslashes // ) " > <sanitizer> <valid initial="string.printable"> <remove value="'"/> @@ -94,7 +94,7 @@ **Example 2** -**Find Pattern:** ^(.{4}) +**Find Pattern:** ^(.{4}) **Replace Pattern:** &\\t Find the first four characters in each line, and replace them with the same text, followed by a tab character. In practice - this will split the first line into two columns. This operation affects only the selected column. @@ -104,7 +104,7 @@ **Extened Regular Expression Syntax** -The select tool searches the data for lines containing or not containing a match to the given pattern. A Regular Expression is a pattern descibing a certain amount of text. +The select tool searches the data for lines containing or not containing a match to the given pattern. A Regular Expression is a pattern descibing a certain amount of text. - **( ) { } [ ] . * ? + \ ^ $** are all special characters. **\\** can be used to "escape" a special character, allowing that special character to be searched for. - **^** matches the beginning of a string(but not an internal line). @@ -112,8 +112,8 @@ - **{** n or n, or n,m **}** specifies an expected number of repetitions of the preceding pattern. - **{n}** The preceding item is matched exactly n times. - - **{n,}** The preceding item ismatched n or more times. - - **{n,m}** The preceding item is matched at least n times but not more than m times. + - **{n,}** The preceding item ismatched n or more times. + - **{n,m}** The preceding item is matched at least n times but not more than m times. - **[** ... **]** creates a character class. Within the brackets, single characters can be placed. A dash (-) may be used to indicate a range such as **a-z**. - **.** Matches any single character except a newline. @@ -121,10 +121,10 @@ - **?** The preceding item is optional and matched at most once. - **+** The preceding item will be matched one or more times. - **^** has two meaning: - - matches the beginning of a line or string. + - matches the beginning of a line or string. - indicates negation in a character class. For example, [^...] matches every character except the ones inside brackets. - **$** matches the end of a line or string. -- **\|** Separates alternate possibilities. +- **\|** Separates alternate possibilities. **Note**: AWK uses extended regular expression syntax, not Perl syntax. **\\d**, **\\w**, **\\s** etc. are **not** supported.