Do not hesitate to pin point improvements.
3 karma · joined June 8, 2024
Do not hesitate to pin point improvements.
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
Which taught me a lot, because at first, i did not understand why we would stop at last line - 2 ($ - 2), but in fact yeah last line is the very last "\n", that is why we stop at $ - 2 to not do E->weird.
I'm starting to truly love sam
Also, while i'm learning it, maybe that the sam traduction for the first file would be simpler, like:
,x/\n +/ c/ /
So if I understand correctly, it’s selection-based, right? You first select a region, and then you can apply further selections inside it?
So you kind of build nested selections to match exactly what you want (almost like a conditional tree).
And then you apply operations on the current selection
For example substitution with something like c/PATTERN/, is that correct?
To clarify: I did spend quite a bit of time diving into `sed` myself (experiments, tests, etc.) and wrote an initial draft in French.
I then used ChatGPT to help me structure and refine the article in English to reach more people. But the core ideas and understanding come from my own exploration.
That said, I understand the concern, and for future articles I'll try to rely less on that kind of tooling for structure.
Happy to clarify or go deeper on any part of the article if needed.