@ivan-k-0 said in Change a certain line in several documents with command/variables:
Is there any command to execute to change this line for each document?
It’s called regular expression search and replace.
Your method of describing your data is rather confusing. I don’t know whether those digits really prefix each line, or if you are just numbering the lines, or numbering the documents that contain that as line#6. Using the Template for Search/Replace questions mentioned below would have helped you communicate more clearly.
But I can come up with a solution that is agnostic of that prefix anyway.
If you want to replace any json ("edition": ###,) line with json ( "external_url":"https://example.com/?token_id=###",) then you can use
FIND = json \("edition": (\d+),\)
REPLACE = json \( "external_url":"https://example.com/?token_id=${1}",\)
SEARCH MODE = Regular Expression
If you have many such lines in the same file, but only want to replace the one on line 6, then change the FIND to \A(?-s:^.*$\R){5}\K^json \("edition": (\d+),\), which looks for the beginning of the file and 5 lines, then restarts the match.
If you allow other characters before the json prefix on line 6, you might have to tweak what comes after the \K to allow that. I will leave that as an exercise for the reader; give it a try using the docs below, and if you cannot figure it out, ask for hints.
----
Useful References
Please Read Before Posting
Template for Search/Replace Questions
FAQ: Where to find regular expressions (regex) documentation
Notepad++ Online User Manual: Searching/Regex