Answer the question
In order to leave comments, you need to log in
How to replace one line with another in yml, if each has different numbers?
Hello! Can you tell me how to replace the data of one row with another?
Rearrange numbers from vendorCode to offer id=
And there are many such values WITH DIFFERENT NUMBERS in files.
I tried formulas in NotePad++ , but it just inserts text, not numbers.
It would be desirable for me to replace only the numbers so that it turns out like this:
Help, please!
Answer the question
In order to leave comments, you need to log in
The general concept is that you need to find all this in one query, and then perform a replacement using the substring statements found.
If you show by example, then you need to replace
(<offer id=")(.*)(".*<vendorCode>)(.*)(<)
with
\1\4\3\4\5
Main do not forget to include "and new lines"
Or if you prefer a picture:
Each bracket found is numbered from one, and they can be used when "replacing". Here we have separated the code from the offer, and the vendor code, and substituted the second instead of the first, and ourselves.
Tested on this text:
<offer id="12312312321" available = true>
sdfa
asdfas
asdfa
sf
<><<>><><><
<vendorCode>261913</vendorCode>
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question