Wikipedia:AutoWikiBrowser/Create new pages
Creating new pages with AutoWikiBrowser
There are at least two different scenarios for creating new pages in Wikimedia:
- When you need to create similar pages, based on a common format, with only several pieces of information different from page to page
- For example, creating stub pages for a lot of cities or plants, with minimum of information
- When you need to import in Wikimedia full-fledged pages which are generated for a 3rd party program
For the first scenario, you can use the CSVLoader plugin developed by Ganeshk - assuming that you have a CSV data file with the basic pieces of information that you need to assemble in articles. Step by step tutorial for creating pages this way you can find on this page.
For the second scenario you can follow the walkthrough below. The procedure described here use a custom batch script that passes to AutoWikiBrowser the generated content for each article, using the External Processing option.
Prerequisites
In order to import pages generated from a 3rd party program into Wikipedia using AWB, you need:
- a computer with Microsoft Windows (XP or later)
- AWB installed and working
- a registered user with approval to use AWB (see details here)
- the pages that you need to import, saved as text files:
- each page saved in a different text file
- each text file having the name of the article to be created (_first_article_name_.txt, _second_article_name.txt etc.) Article names can contain spaces and non-English characters.
- the text files are saved in UTF-8 format if they contain non-English characters
Create a list of articles
You need a file with the list of article names to be created. The text file with the list should be also saved in UTF-8 format if it contains non-English characters.
If you don’t have this list generated by an external tool, you can build it by opening a Command prompt console in the folder where you have the article files and type:
chcp 65001
for %i in (*.txt) do @echo %~ni >> AWBlist.txt
Create the batch script
In the folder where AWB is installed, create a batch script file with the name script.bat and with the following content:
@echo off
chcp 65001
setlocal enableextensions enabledelayedexpansion
set concat=
for %%x in (%*) do set concat=!concat! %%x
set concat=%concat:~1%
copy /Y "C:\_folder_with_my_files_\%concat%.txt" iofile.txt
echo %concat% >> log.txt
Make sure that you replace _folder_with_my_files_ with the actual folder name where you have stored the article text files.
What the script does:
- sets the code page to Unicode (to be able to handle articles with non-English charactes)
- enable the delayed expansion of variables (this is needed for the next step)
- concatenates the parameters given in a single string – this is needed if the article names contain spaces
- removes the first space
- copy the text file named article_name.txt from your source folder as iofile.txt in the AWB folder
- write the name of the article coped in a log file in the AWB folder – you can use this file to analyse if the script was run, if it derived the name correctly etc. in case of issues.
Create link
You can use the batch script above as it is, but this will briefly open a MS-DOS window at each article, that steals the focus. In order to avoid this, we must instruct the AWB to run the script in background.
So create a shortcut to script.bat in the same folder where AWB is installed (just drag script.bat with the right mouse button in a n empty space in the folder, then choose Create shortcut here). Then change the properties of the script - Shortcut.lnk file so that it runs minimized (right-click on it and choose Properties, then change the Run option from Normal Window to Minimized).
Setup AWB
After you start AWB, go to menu Tools -> External processing. In the dialog window enter:
- check Enabled
- Program or script = the full link to the script - Shortcut.lnk file (
C:\_awb_folder_\script - Shortcut.lnk
) - Arguments = %%title%%
- Input/Output file =
C:\_awb_folder_\iofile.txt
- check Pass article as file
Load list and start
In order to load in AWB the list of articles to be imported, you need to use the list that you created in the first step.

In Make list Panel, choose Source: Text file (UTF-8), then click on Make list. Choose the AWBlist.txt file that you have generated. The list of articles should be imported in the panel below.
Other settings:
- Automatic changes: leave as default or change as you need
- More: Append/Prepend text: you need to check this but leave the text edit below empty (otherwise the script is not called)
- Skip: it make sense to choose Skip if Page Exists, in order to no overwrite older pages
- Bots: you can check AutoSave if you use a Bot account and want import automatically without further checks
Then click Start and off you go.