How do I replace a recurring string with another string?

So I have this text file that contains links to a website, I want to replace the “www-website_x-com” string with “www-website_y-com”, how do I go about doing this? I’m running KDE, Is Kate capable of doing this? or maybe some other text editor or document editor something? what about using bash? While looking it up I’ve found something to do with the “sed” command, but It looked very confusing because I’m very unfamiliar with bash and even the little amount python I know I’m not very good at, but feel free to actually let me know anyways, cause I do like learning and I don’t want to go through every occurrence of X with Y one by one.

kate and other editors yes
kate CTRL + R (or menu edition->replace) [option: replace all or one by one]

bash: yes, is sed 's/old-url/new-url/g' # read regex before :wink:

python: not more simple, load file and line by line use line.replace('old_url', 'new_url')

1 Like

thank you very much :heart: you are a HERO!

(Also, that sed command does not look very complicated at all, those people really make it look hard)

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.