Gebruiker:Michiel1972/replace2.py

Uit Wikipedia, de vrije encyclopedie

gebruik: C:\BOT\PYBOT>replace2.py -ref:sjabloon:coördinaten -namespace:0 -regex "([\s\S]*?){{...rdinat en\|(.*?)\|([\s\S]*)" "\2|"


aanpassing in replace.py:


                if new_text == original_text:
                    wikipedia.output('No changes were necessary in %s' % page.title())
                else:
                    wikipedia.output(u'\n>>> %s <<<' % page.title())
                    fileHandle = open ( 'test.txt', 'a' ) 
                    fileHandle.write ('\n'+page.title().encode('utf-8'))
                    fileHandle.write ('\n'+new_text.encode('utf-8'))  
                    fileHandle.close()
                    wikipedia.showDiff(original_text, new_text)


batch bestand intro om vreemde tekens altijd goed te importeren

@echo off
for /f "tokens=2 delims=:." %%x in ('chcp') do set cp=%%x
chcp 1252>nul
replace.py -always -page:"file:Map commune FR insee code 73260.png" -regex "(lity|aises|eente)}}" "\1 Saint-Maurice-de-Rotherens}}" -summary:add_name_commune