Difference between revisions of "Change user in XML export"

From Organic Design wiki
(Perl snippet)
 
(Fix regex accounting for <id> tags too)
Line 5: Line 5:
 
}}
 
}}
  
The Usernames are specified in the <nowiki><username></nowiki> tag, by default an xml export usuarlly dumps the current revision not the history of an article;
+
The Usernames are specified in the <nowiki><username></nowiki> tag, by default an xml export usually dumps the current revision not the history of an article;
  
 
{{code|<PHP>
 
{{code|<PHP>
perl -ne 's/(\<username\>)\w+?(\<\/username\>)/$1WikiSysop$2/g ; print ' IN.xml > OUT.xml
+
perl -ne 'ss/(\<username\>)\w+(\<\/username\>\s+\<id\>)\d+(\<\/id\>)/${1}WikiSysop${2}1${3}/g ; print ' IN.xml > OUT.xml
 
</PHP>
 
</PHP>
 
}}
 
}}

Revision as of 04:21, 2 December 2008

Procedure.svg Change user in XML export
Organic Design procedure

The Usernames are specified in the <username> tag, by default an xml export usually dumps the current revision not the history of an article;


<PHP>

perl -ne 'ss/(\<username\>)\w+(\<\/username\>\s+\<id\>)\d+(\<\/id\>)/${1}WikiSysop${2}1${3}/g ; print ' IN.xml > OUT.xml </PHP>