Home Download Buy Blog Forum Support

How to replace multiple characters in files using regex?

How to replace multiple characters in files using regex?

Postby attanze on Sun Feb 19, 2012 8:18 am

Hello. I recently have the challenge to replace some special characters (Þ , þ , ª , º , ã , ) from a lot of files and replace them with other special characters: ( Ț , ț , Ș , ș , ă , ). The first ones are using the Western Windows 1252 encoding and the second ones are UTF-8.

I want to know if is possible to replace all this characters in one search using regex instead of searching and replacing five times.

Any help will be appreciated. Thank you.
attanze
 
Posts: 16
Joined: Sun May 01, 2011 8:30 pm

Re: How to replace multiple characters in files using regex?

Postby attanze on Sun Feb 19, 2012 8:55 am

Researching, I made some progress. Now I can find all the desired characters in one search using formula:
(Þ)|(þ)|(ª)|(º)|(ã)

The only question that remains is how to replace them accordingly, in the following order:
Ț , ț , Ș , ș , ă
attanze
 
Posts: 16
Joined: Sun May 01, 2011 8:30 pm


Return to Technical Support

Who is online

Users browsing this forum: Google [Bot], lefoy and 34 guests