If I wanted to insert an ‘i’ at the beginning of every line from a readFile(), does anyone know how to do that?
I am trying readFile "file.txt" | replaceRE "^" "i"
but that is only working for the first line in the file. I can’t find a way for that regex to be made global or multiline. “/^/gm” and the link don’t work to replace anything.
Edit: As a very hacky workaround, I am using replace() to replace “\n” with “_nl_i”, then using replace again to replace “nl” with “\n”. Strange that replace() works multiline but replaceRE() doesn’t seem to.
If there is a better way to handle this, I’d love to hear it.