0

I have sql dump of mydatabase, and I must using notepad++ change all links in format foto-kraków-01.jpg to foto-krakow-01.jpg. I try to use find and replace using *ó*.jpg and replace to *o*.jpg but i don't work.

Please, give me advice how to do that in few simply steps. Summary i want to replace only filenames with polish marks (ó,ę,ż,ą) to (o,e,z,a)

Regards

Tomek R
  • 39
  • 3
  • 1
    See my recent answer on [this](https://stackoverflow.com/questions/47313212/regex-substitute-several-special-characters-with-other-special-characters-in-tex/47313997#47313997) post. You create a dictionary, append it to the file and let it do the work for you. – ctwheels Nov 16 '17 at 20:37
  • What about `ć`, `ń`, `ź`, `ś`, `ł`? @ctwheels These problems are different as those were multibyte letters, and here, they are precomposed Unicode characters. – Wiktor Stribiżew Nov 16 '17 at 20:37
  • If I will be know how to change ó,ę,ż,ą I will be able to modify that and change also ć,ń,ź :) – Tomek R Nov 16 '17 at 20:39
  • You can really just replace all `ó` with `o`, `ą` with `a` using a plain text replacement. Or do you mean you want to replace them *only* in a specific context? If yes, how do you define this context? Like `\S*\.jpg`? Any non-whitespace chunk that is supposedly a JPG file name? This is possible, but could you please some more examples of input/output? – Wiktor Stribiżew Nov 16 '17 at 20:40
  • @WiktorStribiżew they would just add those elements to the dictionary and map them to new letters, say `c`, `n`, `z`, `s`, `l`. Something like [this](https://regex101.com/r/taSFeI/1) – ctwheels Nov 16 '17 at 20:45
  • This is dump from my WordPress. I don't know why writers posted images with polish marks in filenames of pictures so i must edit string only with .jpg endings foto-kraków-01.jpg to foto-krakow-01.jpg because i have to rename all files in FTP – Tomek R Nov 16 '17 at 20:45
  • @ctwheels I have just understood that you created a very weird work around while there is a simple native Notepad++ solution to it. – Wiktor Stribiżew Nov 16 '17 at 20:46
  • @TomekR What do you mean by *string*? Please talk regex. *One or more chars other than whitespace followed with `.` and then `jpg`*? Or what? – Wiktor Stribiżew Nov 16 '17 at 20:47
  • @WiktorStribiżew I've had to use this weird alternative before for conditional replacements in text editors since they typically don't allow for custom code. So the alternative is to create a custom dictionary and have it use the dictionary values as the replacements. Which native solution are you referring to? – ctwheels Nov 16 '17 at 20:47
  • @ctwheels Conditional replacement pattern in Notepad++. You mentioned you used it in Notepad++, that is why it is a work around *there*. – Wiktor Stribiżew Nov 16 '17 at 20:48
  • @WiktorStribiżew :O I've just discovered your post. I did not know Notepad++ had those capabilities! – ctwheels Nov 16 '17 at 20:50
  • @WiktorStribiżew are you talking about the issue of using sets? The user can use `(ó)|(ę)|(ż)|(ą)|(ć)|(ń)|(ź)|(ś)|(ł)` instead no? – ctwheels Nov 16 '17 at 20:53

0 Answers0