From e693c214733e8abf85127b016b4cfd8c4043060f Mon Sep 17 00:00:00 2001 From: Dinindu Senanayake Date: Mon, 15 Apr 2024 21:48:12 +1200 Subject: [PATCH] replace chr1 with chromosome 1 for awk --- docs/5_inspectmanipulate2.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/5_inspectmanipulate2.md b/docs/5_inspectmanipulate2.md index 2f60bf6..f8fed25 100644 --- a/docs/5_inspectmanipulate2.md +++ b/docs/5_inspectmanipulate2.md @@ -163,7 +163,7 @@ One of the powerful features is that we can combine these ranges or multiples in approach and use .* . Consider: - - - - ``` + ## Aho, Weinberger, Kernighan = AWK @@ -238,7 +238,7 @@ awk options 'selection_criteria {action}' input-file > output-file !!! terminal-2 "Print lines which match the given pattern" ```bash - awk '/chr1/{print}' example.bed + awk '/chromosome1/{print}' example.bed ``` >```bash >chromosome1 26 39 @@ -319,7 +319,7 @@ We can also chain patterns, by using logical operators `&&` (AND), `||` (OR), an - First pattern, `$1 ~ /chr1` specifies the regular expression (All Regular expressions are in slashes). We are matching the first field, `$1` against the regular expression `chr1`. - Tilde `~` means **match**. - - To do the inverse of **match**, we can use `!~` OR `!($1 ~ /chr1/)` + - To do the inverse of **match**, we can use `!~` OR `!($1 ~ /chromosome1/)`