|
|
|
|
|
by jlp__inf
89 days ago
|
|
and yess, g/PATTERN/ and /v/PATTERN/ are supzr powerful, creating branch conditions based on wether or not they (do not)match a PATTERN. based on what you wrote: i just add trailing \n normalization at the end , x/(.+\n)+|\n+/ {
g/./ x/\n/ c/ /
v/./ c/\n/
}
$ a/\n/
, x/\n+$/ c/\n/
w file_out.txt
q |
|
I’m glad that sam worked out for you. You can learn more from [1] and [2]. If you need any help, you’re always welcome to ask me.
[1]: https://ratfactor.com/papers/sam_tut.pdf
[2]: https://9p.io/sources/contrib/steve/other-docs/struct-regex....