You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that the replacement supports capture variables.
1028
1028
e.g. $1 represents the text of the first submatch.
@@ -1038,14 +1038,20 @@ Or use the \ escape character.
1038
1038
1039
1039
more on: http://shenwei356.github.io/seqkit/usage/#replace
1040
1040
1041
+
Special repalcement symbols:
1042
+
1043
+
{nr} Record number, starting from 1
1044
+
{kv} Corresponding value of the key ($1) by key-value file
1045
+
1041
1046
Usage:
1042
1047
seqkit replace [flags]
1043
1048
1044
1049
Flags:
1045
1050
-s, --by-seq replace seq
1046
1051
-i, --ignore-case ignore case
1052
+
-k, --kv-file string tab-delimited key-value file for replacing key with value when using "{kv}" in -r (--replacement)
1047
1053
-p, --pattern string search regular expression
1048
-
-r, --replacement string replacement. supporting capture variables. e.g. $1 represents the text of the first submatch. ATTENTION: use SINGLE quote NOT double quotes in *nix OS or use the \ escape character. record number is also supported by "{NR}"
1054
+
-r, --replacement string replacement. supporting capture variables. e.g. $1 represents the text of the first submatch. ATTENTION: use SINGLE quote NOT double quotes in *nix OS or use the \ escape character. Record number is also supported by "{nr}"
checkError(fmt.Errorf(`value of -p (--pattern) must contains "(" and ")" to capture data which is used specify the KEY`))
102
+
}
103
+
ifkvFile=="" {
104
+
checkError(fmt.Errorf(`since repalcement symbol "{kv}"/"{KV}" found in value of flag -r (--replacement), tab-delimited key-value file should be given by flag -k (--kv-file)`))
0 commit comments