Remplace text in middle on line
Posted: Thu May 12, 2011 5:53 am
Hello,
Thanks for this wonderful and very useful tool.
I'm totaly not familiar with wild card and other expressions like regex. So please bear with me!
I'll just start off by providing you with an exemple i'm working on:
Multiple batch files containing only one line. here are two batch files for example:
1st file:
%SystemRoot%\explorer.exe /e,\\ctsvmainsaver\Documents\Documents Secteur Atelier Principal\Departements\5159-200 Tonnes\218-5220
2nd file:
%SystemRoot%\explorer.exe /e,\\ctsvmainsaver\Documents\Arborescence Mainsaver\USINE CRABTREE\SF 200 TPD PLANT\159-VENTILATION\404-7070
In both files (and in the other 1397 batch files awaiting me)the text to be replaced always starts from the end of the first '\documents\' and ends at just before the last '\' in the line. The replcement text is the same for both and all the other files: MACHINE-FIBRE-SERVICE\DOCUMENT PAR ACTIF
So here's how the 1st and 2nd files should like after a find and replace:
1st file:
%SystemRoot%\explorer.exe /e,\\ctsvmainsaver\Documents\MACHINE-FIBRE-SERVICE\DOCUMENT PAR ACTIF\218-5220
2nd file:
%SystemRoot%\explorer.exe /e,\\ctsvmainsaver\Documents\MACHINE-FIBRE-SERVICE\DOCUMENT PAR ACTIF\404-7070
How do I configure a regular expression or a Regex to do the job?
MAny thanks in advance for giving me a hand!!
Thanks for this wonderful and very useful tool.
I'm totaly not familiar with wild card and other expressions like regex. So please bear with me!
I'll just start off by providing you with an exemple i'm working on:
Multiple batch files containing only one line. here are two batch files for example:
1st file:
%SystemRoot%\explorer.exe /e,\\ctsvmainsaver\Documents\Documents Secteur Atelier Principal\Departements\5159-200 Tonnes\218-5220
2nd file:
%SystemRoot%\explorer.exe /e,\\ctsvmainsaver\Documents\Arborescence Mainsaver\USINE CRABTREE\SF 200 TPD PLANT\159-VENTILATION\404-7070
In both files (and in the other 1397 batch files awaiting me)the text to be replaced always starts from the end of the first '\documents\' and ends at just before the last '\' in the line. The replcement text is the same for both and all the other files: MACHINE-FIBRE-SERVICE\DOCUMENT PAR ACTIF
So here's how the 1st and 2nd files should like after a find and replace:
1st file:
%SystemRoot%\explorer.exe /e,\\ctsvmainsaver\Documents\MACHINE-FIBRE-SERVICE\DOCUMENT PAR ACTIF\218-5220
2nd file:
%SystemRoot%\explorer.exe /e,\\ctsvmainsaver\Documents\MACHINE-FIBRE-SERVICE\DOCUMENT PAR ACTIF\404-7070
How do I configure a regular expression or a Regex to do the job?
MAny thanks in advance for giving me a hand!!