Answer the question
In order to leave comments, you need to log in
How to set attributes in notepad++ automatically?
There is an example in the photo of how the attributes should be affixed.
There are many employee cards of the same type that need to be put down attributes where there are none
The question is how to do it quickly
Answer the question
In order to leave comments, you need to log in
Type in the console in the browser or through the node:
const props = ['prop1', 'prop2', ... , 'prop5'];
let i = 0;
const n = props.length;
console.log(
`твой хтмл в виде текста`.replace(/td itemprop=""/g, () => {
const newProp = `td itemprop="${props[i]}"`;
i = (i + 1) % n;
return newProp;
})
);
In the settings, turn on multi-editing, hold down Ctrl and poke the cursors where necessary, then type in the values.
From more complicated:
In the case of XML, there is an XMLTools plugin, which can be used to execute expressions using XPath, thus modifying the document where necessary, again, you need to know XPAth / XSLT queries.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question