Answer the question
In order to leave comments, you need to log in
Enums in notepad++?
Good day everyone! There was a question, there are a bunch of lines like:
add name="pnachmed" target=192.168.0.121 max-limit=5M/5M
add name="mam1" target=192.168.0.122 max-limit=5M/5M
add name="hz-comp3" target=192.168.0.123 max-limit=5M/5M
add name="zavhoz" target=192.168.0.124 max-limit=5M/5M
add name="1" target=192.168.0.121 max-limit=5M/5M
add name="2" target=192.168.0.122 max-limit=5M/5M
add name="3" target=192.168.0.123 max-limit=5M/5M
add name="4" target=192.168.0.124 max-limit=5M/5M
and so on... Answer the question
In order to leave comments, you need to log in
Nothing in notepad++, but easy in PHP:
$data = explode(PHP_EOL, file_get_contents('data.txt') );
foreach($data as $id => $value){
$data[$id] = preg_replace('/name\=\"([^\"]*)\"/ui', 'name="' . ($id+1) . '"', $value);
}
file_put_contents('new_data.txt', implode(PHP_EOL,$data) );
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question