You are here: PSPad forum > České diskuzní fórum > Re: Hromadne premenovanie urcitych riadkov

Re: Hromadne premenovanie urcitych riadkov

#1 Hromadne premenovanie urcitych riadkov

Posted by: Dreamer | Date: 2021-04-09 21:16 | IP: IP Logged

Zdravim, prosim o pomoc, ako mam hromadne premenovat text ako v priklade nizsie, potrebujem nahradit znak "-" znakom "_", ale iba v riadkoch "<Name>", nie v inych riadkoch, je to mozne?

<Icon>
<Name>archive-add2@@@</Name>
<StockIconName>archive.axvi</StockIconName>
<StockIconSet>Basic</StockIconSet>
<StockOverlayName>add-2.axvi</StockOverlayName>
<ResourceIDValue>109</ResourceIDValue>
<ResourceID>ID_ARCHIVE-ADD2@@@</ResourceID>
<OverlayOffset>1</OverlayOffset>
<Opacity>255</Opacity>
<ColorizeMode>0</ColorizeMode>
<ColorizeOverlay>#3E78B3</ColorizeOverlay>
<StockOverlayPos>2</StockOverlayPos>
<DarkMode>0</DarkMode>
</Icon>

Options: Reply | Quote | Up ^


#2 Re: Hromadne premenovanie urcitych riadkov

Posted by: pspad | Date: 2021-04-10 08:13 | IP: IP Logged

Hledat: (<name>.*)\-(.*</name>)
Nahradit: $1_$2
[x]Regularni vyrazy

Casti v kulatych zavorkach jsou pri nahrazeni pak dosazeny za $n podle pořadí ve výrazu

Options: Reply | Quote | Up ^


#3 Re: Hromadne premenovanie urcitych riadkov

Posted by: Dreamer | Date: 2021-04-10 10:49 | IP: IP Logged

Dakujem, funguje to, ale ak je "-" v nazve viackrat, nahradi sa len posledny znak.

Priklad:

<Name>ad-dr-ess-bar</Name>

Vysledok je:

<Name>ad-dr-ess_bar</Name>

Po opakovanych akciach sa nahradia aj ostatne vyskyty, ale neda sa to spravit naraz?

Options: Reply | Quote | Up ^


#4 Re: Hromadne premenovanie urcitych riadkov

Posted by: Dreamer | Date: 2021-04-11 20:37 | IP: IP Logged

OK, uz som to spravil na viackrat, vyriesene.

Options: Reply | Quote | Up ^






Editor PSPad - freeware editor, © 2001 - 2021 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR