Mercurial > repos > bgruening > text_processing
comparison awk.xml @ 8:4c752559b236 draft
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/text_processing/text_processing commit 3103ebed1a420c7d3415b67ef532ea579edf9faa
author | bgruening |
---|---|
date | Wed, 12 Jul 2017 14:07:57 -0400 |
parents | 60edf2f8c28f |
children | 74a8bef53a00 |
comparison
equal
deleted
inserted
replaced
7:01ca80da2266 | 8:4c752559b236 |
---|---|
78 - **$2 == "chr3"** will match lines whose second column is the string 'chr3' | 78 - **$2 == "chr3"** will match lines whose second column is the string 'chr3' |
79 - **$5-$4>23** will match lines that after subtracting the value of the fourth column from the value of the fifth column, gives value alrger than 23. | 79 - **$5-$4>23** will match lines that after subtracting the value of the fourth column from the value of the fifth column, gives value alrger than 23. |
80 - **/AG..AG/** will match lines that contain the regular expression **AG..AG** (meaning the characeters AG followed by any two characeters followed by AG). (This is the way to specify regular expressions on the entire line, similar to GREP.) | 80 - **/AG..AG/** will match lines that contain the regular expression **AG..AG** (meaning the characeters AG followed by any two characeters followed by AG). (This is the way to specify regular expressions on the entire line, similar to GREP.) |
81 - **$7 ~ /A{4}U/** will match lines whose seventh column contains 4 consecutive A's followed by a U. (This is the way to specify regular expressions on a specific field.) | 81 - **$7 ~ /A{4}U/** will match lines whose seventh column contains 4 consecutive A's followed by a U. (This is the way to specify regular expressions on a specific field.) |
82 - **10000 < $4 && $4 < 20000** will match lines whose fourth column value is larger than 10,000 but smaller than 20,000 | 82 - **10000 < $4 && $4 < 20000** will match lines whose fourth column value is larger than 10,000 but smaller than 20,000 |
83 - **BEGIN** will be executed once only, before the first input record is read. | |
83 - If no pattern is specified, all lines match (meaning the **action** part will be executed on all lines). | 84 - If no pattern is specified, all lines match (meaning the **action** part will be executed on all lines). |
85 | |
84 | 86 |
85 | 87 |
86 **Action Examples** | 88 **Action Examples** |
87 | 89 |
88 - **{ print }** or **{ print $0 }** will print the entire input line (the line that matched in **pattern**). **$0** is a special marker meaning 'the entire line'. | 90 - **{ print }** or **{ print $0 }** will print the entire input line (the line that matched in **pattern**). **$0** is a special marker meaning 'the entire line'. |
89 - **{ print $1, $4, $5 }** will print only the first, fourth and fifth fields of the input line. | 91 - **{ print $1, $4, $5 }** will print only the first, fourth and fifth fields of the input line. |
90 - **{ print $4, $5-$4 }** will print the fourth column and the difference between the fifth and fourth column. (If the fourth column was start-position in the input file, and the fifth column was end-position - the output file will contain the start-position, and the length). | 92 - **{ print $4, $5-$4 }** will print the fourth column and the difference between the fifth and fourth column. (If the fourth column was start-position in the input file, and the fifth column was end-position - the output file will contain the start-position, and the length). |
93 - **{ FS = "," }** can be used to change the field separator (delimeter) for parsing the input file. | |
91 - If no action part is specified (not even the curly brackets) - the default action is to print the entire line. | 94 - If no action part is specified (not even the curly brackets) - the default action is to print the entire line. |
92 | 95 |
93 | 96 |
94 **AWK's Regular Expression Syntax** | 97 **AWK's Regular Expression Syntax** |
95 | 98 |