It has been suggested that this project page should be merged with MW:Manual:Importing external content. |
All categories and pages that start with 'Commons' in the name are for internal Commons work. They contain resources, help, tools, instructions, links, FAQs, examples, labs, software, etc. They are not for categorization of images and media files used outside of internal Commons work. Please do not categorize regular image or media files here. Instead, see the main categories and subcategories at the Main Page and here. See also: Category help and category search. Search the Commons namespace at Special:Search. |
Here are some tools, resources, tips, and instructions for converting tables and charts to wiki code or image files. Most of the tools and resources are free. For more tools see Commons:Create charts and graphs online.
Excel merupakan program spreadsheet pertama yang mengizinkan pengguna untuk mendefinisikan bagaimana tampilan dari spreadsheet yang mereka sunting: font, atribut karakter, dan tampilan setiap sel. Excel juga menawarkan penghitungan kembali terhadap sel-sel secara cerdas, di mana hanya sel yang berkaitan dengan sel tersebut saja yang akan. The Wikipedia app automatically searches Wikipedia topics based on your selection in an Office document and displays results in a task pane. The content in the task pane is organized in sections for easy navigation, and you can choose to view both text and images, or only images.
Some starting points[edit]
- en:Help:Table. Visual Editor is much improved concerning tables. See section on Visual Editor.
Sandboxes[edit]
Sandboxes help a lot. For example; your user page: Special:MyPage. Create and bookmark some personal sandboxes too: Special:MyPage/Sandbox, Special:MyPage/Sandbox2, Special:MyPage/Sandbox3. As many as you want. Share the link when asking for help. Wikipedia user pages have Visual Editor enabled by default. But not on talk pages. Visual Editor will load very fast in empty sandboxes. To find all your sandboxes: Special:PrefixIndex/User: - click link, add user name to spot labeled 'Display pages with prefix:'
Web table (HTML-based) to wiki code[edit]
LibreOffice[edit]
Convert web page tables (HTML-based) to wiki code. You can save any web page as an HTML file, and then open it in LibreOffice Writer. Sometimes you can paste parts of web pages directly into LibreOffice Writer. Continue editing there. Remove non-table stuff for example. Then export it to Mediawiki:
- LibreOffice Writer is free. It can open almost any file format. It can export to Mediawiki. File menu > export > save as type > MediaWiki. It will save the file as a .txt file which can be opened with any text editor. Copy the wiki code from the text file.
Other more technical tools[edit]
- HTML to Wiki Converter. 'This is a slightly altered mirror of a script by Borislav Manolov.' Hosted at Wikimedia Toolforge on Magnus' tools. See User:Magnus Manske. Enter HTML markup. Retrieve wiki markup.
- Python wikipedia robot framework (pywikipediabot). It can convert HTML tables to wiki code.
- HTML WikiConverter. Convert HTML to wiki markup. Various versions and languages.
Online tools. Convert Excel or PDF. To wiki code[edit]
- tab2wiki. Converts tables (tab-delimited, e.g. copied from Excel, LibreOffice Calc) to Wikitext tables. Hosted at Wikimedia Toolforge on Magnus' tools.
- excel2wiki. Copy and paste cells from Excel and click 'convert'. You can also paste any plain text list (text and/or numbers) into Excel2Wiki. Click 'convert'. Copy the wikitext result.
- Convert PDF to Excel Free Online - No email required. This free site works great. Upload PDF. Converts to Excel file in less than a minute. Download it. Open it with freeware LibreOffice Calc. See next section on how to convert Calc to wiki code.
Web to LibreOffice Calc to tab2wiki or excel2wiki[edit]
- Note: Visual Editor is much improved concerning tables. See: Help:Table and the section on Visual Editor. See the conversion example described farther down using LibreOffice Calc and Visual Editor.
This is a fairly easy method. This method works with plain tables from web pages. It does not usually work well with complicated tables on web pages (JavaScript based, etc.). Launch freeware LibreOffice Calc. Go to the web page with the table. Select and copy it right off the web page. Do not go into the HTML. Paste it into Calc.
If you happen to have a spreadsheet for the table use it instead and open it directly with Calc.
Then select and copy right off the Calc page. You can select the whole table, or just the columns you want by clicking the top of the desired columns in Calc (ctrl-click for each additional column). You can select exactly what you want by clicking a top corner of the rectangle area of the Calc table you want. Then shift-click the opposite corner of the rectangle. Your chosen rectangle will now be selected. Copy it from the edit menu.
Paste it into tab2wiki. Or into excel2wiki. Try each one if necessary in case one is not working. Copy the wikitext, and paste it into a wiki page. This method is very fast, and produces very clean and compact table wikitext.
It is compact when 'First element in a row is a header' is left unchecked (default setting) in tab2wiki. And be sure 'Compress table' is checked. Each table row will be on one line of wikitext. Otherwise every cell in the table will have its own row of wikitext.
This is why pasting the table into tab2wiki is sometimes better than pasting it into VisualEditor. VE may not keep the table row in the compressed format. Also, tab2wiki is sometimes much faster. Pasting a table into VisualEditor (at least in Firefox) can sometimes almost lock it up for a few minutes as it does its translation. May have to tell the script to keep going. In contrast, tab2wiki is almost instant.
Sometimes a table can be copied and pasted directly from a web page into tab2wiki.
Calc can be used to easily remove columns and rows. Or use VisualEditor to do that. In either case click the column head, and then right click and delete. Columns can easily be moved around in Calc. Use cut and paste. For dragging columns around see this thread.
Default Calc settings will remove trailing zeros after the decimal point. If desired, this can be fixed after pasting into Calc. Select the relevant data rows or columns from the table. Then click on 'cells' from the format menu. Choose the number of decimal places to show. This will return the trailing zeros. They make sortable data columns easier to scan.
Sometimes you do not want anything after the decimal point. Click the column head to select that column. Then right click it, and click on 'format cells' from the context menu that pops up. Click on the example number showing no decimal point. Then click OK.
Sort by rank or alphabetically. Use LibreOffice Calc[edit]
While in Calc you may want to put one of the table columns in alphabetical or rank order. In Calc click on any cell in the column you want to sort the table by. Then click one of the sort options (ascending or descending) from the data menu at the top.
Alphabetical tables are the easiest way to keep some tables up to date without having to constantly redo rank numbers. Other tables can be put in rank order if they are usually updated all at once. For more info see Help:Sorting.
Quickly link long lists of countries[edit]
This particular set of regular expressions only works for compact tables where there are rows of wikitext using double bars || to separate cells. The country names must be in the first column. Also, this find-and-replace must be done before other formatting of those first cells in rows. Such as a text-align style.
See this Stack Overflow discussion with examples and pictures. Look especially at the screenshot of the settings while doing the find-and-replace. See the answer by Erutan409. It explains how to instantly add [[wikitext brackets]] around all the country names. The example below is for freeware Notepad++. It has Unicode capability, and will work with more languages. The regex code below has also been successfully used in another freeware program, NoteTab Light. It does not have Unicode capability.
Copy the table wikitext to a Notepad++ page. Go to: Search menu, Replace. Check the boxes for 'regular expression' and 'wrap around' and 'down'. Click the mouse cursor at the top of the table wikitext so that all the country names going down the page have brackets added. Copy this regular expression (regex) code to the find and replace forms:
^.*?|h*K(.*?)(?=h*|)
replace with[[$1]]
Then click 'Replace all'. Just clicking 'Replace' one at a time may not work.
Brackets are added around both ends of country names, including country names consisting of more than one word. It only does this in the first cell of each row. In other words the country names before the first set of double bars in the wikitext for tables in the compact format (one line per table row). This is very useful in Wikipedia tables since it saves a lot of time versus manually linking a couple hundred country names. Some names may be red-linked. They need redirects to the main country name.
The redirects save much time later when updating the table since the redirects only need to be done once. Redirects are kept as long as they are in use somewhere on Wikipedia. Keep a user sandbox just for this particular table update. Don't overwrite it. That way a 'What links here' search will find that the redirects are in use, and so the redirects are less likely to be deleted. Leave a note in the edit summary as you create the redirect. Something like 'Please do do not delete this redirect. It is used when updating a table.'
Link and add flags. Long or compact table wikitext[edit]
- This works with compact or long table wikitext. Single or double bars between cells.
- Note:en:User:PrimeHunter (Talk) provided the code.
- Note: In editing preferences check the box: 'enable the editing toolbar. This is sometimes called the '2010 wikitext editor'.'
Make sure the countries are in the first column. The regular expression wraps all the text in the first cell of each row with the {{Flaglist}} template. {{flaglist|Country name}}
. So do this before adding any styling to the first column.
Click on the wikitext source editing link. Click on 'Advanced' in the editing toolbar. Then click on the search and replace icon on the right. Put a check in the box called 'Treat search string as a regular expression.' Fill in the 'Search for' box with (|-.*n|s*)([^|n]*)
. Fill in the 'replace with' box with $1{{flaglist|$2}}
. Then click 'Replace all'. Nearly all countries will be linked and will have flags.
For the red links create redirects as necessary. Save this table permanently in a user sandbox (without overwriting it) so that the redirects are kept due to being in use. Otherwise, admins will delete unused redirects, and you will have to do this tedious, time-consuming redirect task every time you fully update the table. In the edit summary of such redirects, add something like this: 'Please do not delete this redirect. It is sometimes used in updates of [[NAME OF ARTICLE WITH TABLE]].'
Align cell data to right of cells[edit]
Add style=text-align:right
to the top of the table wikitext.
For example:
{| border=1 style=text-align:right
Align country names to left of cells[edit]
Excel Wikipedia
Add style=text-align:left
to each country name cell. Or align=left
Symantec endpoint protection 14 for mac free download. If there are flag templates this is very easy to do. Replace {{
with:
align=left|{{
If there are no flag templates it can be done quickly in many text editors by finding and replacing wikitext all at once. Note the pattern below:
In freeware NoteTab Light replace |-^p|[[
with |-^p| style=text-align:left | [[
Contexts 3 6 2 – fast window switcher panel. ^p is the NoteTab code for line breaks. Click 'replace all' to end up with:
If there are no links other than country links in the table then just replace [[
with style=text-align:left | [[
Conversion examples. Sandboxes for updating tables.[edit]
Return to top. See: User:Timeshifter/Sandbox110 for the short version of instructions to update a table.
User sandboxes with info for updating tables with country lists. Most examples use the Visual Editor at some point. So be sure it is not disabled in preferences. On the Wikimedia Commons you may need to enable it. Do so here: Special:Preferences#mw-prefsection-betafeatures.
- COVID-19 pandemic death rates by country. See: User:Timeshifter/Sandbox107.
- Estimated number of civilian guns per capita by country. See: User:Timeshifter/Sandbox81.
- List of countries by incarceration rate. See: User:Timeshifter/Sandbox98.
- Iraq Body Count project. See: User:Timeshifter/Sandbox106.
From Help:Table: Sandboxes help a lot. For example; your user page: Special:MyPage. Create and bookmark some personal sandboxes too. Visual Editor will load very fast in empty sandboxes: Special:MyPage/Sandbox, Special:MyPage/Sandbox2, Special:MyPage/Sandbox3. As many as you want. Share the link when asking for help. To find all your sandboxes: Special:PrefixIndex/User: – click link, add user name to the spot labeled 'Display pages with prefix:'.
Conversion. List of countries by incarceration rate[edit]
See: List of countries by incarceration rate. And the how-to info here: w:User:Timeshifter/Sandbox98. And: w:User:Timeshifter/Sandbox79 (older method).
LibreOffice Calc and Visual Editor[edit]
Full rapid update of List of countries by incarceration rate.
w:User:Timeshifter/Sandbox98 has an easier method, and there is less need for LibreOffice Calc. See en:Help:Table and its section on the WP:Visual Editor.
See also: w:User:Timeshifter/Sandbox79. It has a table, and instructions on how to create it using freeware LibreOffice Calc and Visual Editor.
Please do not delete the country redirects. This allows the table to be fully updated much more often. It only takes half an hour to fully update the table if redirects do not also have to be recreated each time (which can take hours). The source page uses these country, territory, and subnational names.
Alternative older method[edit]
For an example see: w:User:Timeshifter/Sandbox74.
This is an alternative method to using LibreOffice Calc, tab2wiki, and/or Visual Editor as discussed on this page, or elsewhere. Sometimes alternatives are required. That is why this info has been kept below, even though LibreOffice Calc and Visual Editor will work for this particular table.
See the long table at en:List of countries by incarceration rate. It has over 200 rows. It is too difficult to maintain the table in highest to lowest order. That order can change with a single country update by any random editor. Plus one gets highest to lowest order by clicking the rate header. Alphabetical order is easy to maintain, because it is not affected by multiple small changes in the stats. To add row numbering see en:Help sorting.
Source: Highest to Lowest. World Prison Brief. International Centre for Prison Studies. Use dropdown menu to choose lists of countries by region, or the whole world. Use menu to select highest-to-lowest lists of prison population totals, prison population rates, percentage of pre-trial detainees / remand prisoners, percentage of female prisoners, percentage of foreign prisoners, and occupancy rate. Column headings in tables can be clicked to reorder columns lowest to highest, or alphabetically.
Use the menus to create a whole world list of prison population rates. Then click on the country column to put it in alphabetical order. Then copy and paste it into an online HTML WYSIWYG editor such as this one:
- HTML EDITOR.in: Free Online WYSIWYG HTML and HTML5 Editor. To get the one just for your browser click on the link: 'To use TinyMCE editor Click here'.
Click inside the editing area. To paste in the table use the edit menu of your browser, and then click 'paste'. After pasting in the table remove the rank column. To do this click anywhere in the rank column. Then click on the toolbar button that says (tooltip) 'remove column'. Then go into source mode to get the HTML. The table HTML starts with and ends with .
There are many free HTML editors that can remove table columns, and do other table editing. For example; KompoZer. Place cursor in column heading. Then; table menu, delete column. You can also select all, right click, and 'remove all text styles'.
Copy only the table HTML, and paste it into the 'HTML markup' form of the online HTML to Wiki Converter hosted by Magnus Manske. It is here. Click 'convert' at the bottom of the converter page. It converts the table HTML to wiki code (wikitext). Paste it into a sandbox or one of your user pages (or subpages) to see what it looks like as a MediaWiki table.
The wikitext needs to be cleaned up. To do so quickly, copy the wikitext into a blank page of a good free text editor such as NoteTab Light. Save this as a text file. Remove the CSS styling at the top of the table wikitext. It is unnecessary. Then use the text editor's find-and-replace tool to remove all the classes. Replace double spaces with single spaces. Repeat until no double spaces remain. Fix any text laddering. Some of it can be done with find-and-replace. For example; replace with . Save the text file.
Country (or dependent territory, subnational area, etc.) | Incarceration rate (Prisoners per 100,000 population) |
---|
First replace with nothing.
Then remove the rest of the HTML used for the country links. Put a checkmark in the regular expression checkbox, and then remove everything between HTML tag brackets: <>
Pubg emulator download for mac. To do that paste this regular expression in the 'find what' line:
- <.*?>
In the 'replace with' line put this:
- style='text-align:left' |
Click 'replace all.' This instantly removes nearly all HTML code. It replaces it with styling that aligns the country names to the left. The names are easier to read that way.
Adding country links and flags[edit]
Alternatively, you can add country linking and flag icons (see: en:Template:Flaglist). To do so replace with template end brackets: }} Then replace the remaining HTML using the regular expression method. Put a checkmark in the regular expression checkbox, and then remove and replace everything between HTML tag brackets <>
Those 2 changes should make all the country names into wikilinks, and adds flag icons in front of them. It also aligns the country text to the left. For example; see en:User:Timeshifter/Sandbox42. In some country lists created this way some of the country links may have to be created manually. This is because there is a need to create redirects to the country names used for these links. Fortunately, nearly all the redirects have been created for this country list. For the combined UK number for England and Wales add this manually to keep both flags:
Also add this for Sint Maarten:
For more info see: en:Wikipedia:WikiProject Flag Template, en:Category:Country data templates and en:Category:Country data redirects. Country links and flag icons are not absolutely necessary in country lists. Timely updating of the list is more important. If you want flags and country links, and you want to be able to rapidly update a list you may need to create some redirects. To do so search here for the templates to redirect to. Add the country or territory name to the search. |
Do some additional manual cleaning, if necessary, to get rid of the rest of the HTML. There shouldn't be a need to do so for en:List of countries by incarceration rate.
Adding a column for notes[edit]
A column for notes (if necessary) is instantly added by adding another column with the Visual Editor (VE). See the VE section of Help:Table.
Another fast method is doing a regular find-and-replace. In NoteTab Light replace
- |-
- with
- |^p|-
- ^p is the NoteTab code for line breaks.
- |- is the wikitext for a table row.
- | is the wikitext for a table cell. See meta:Help:Table.
For consistency use the same reference for all the countries and territories possible. That reference link is placed above the table. If rates for additional countries or territories are found they can be entered in the table, and info about the sources can be put in the notes section below the table.
Do not put references or long notes in the table. They will break the alignment of the row numbering. See en:Help:Sorting sections about row numbering. Point to the notes section below the table. For example; see List of countries by incarceration rate.
PDF to image files[edit]
See: Commons:PDF to image files
Add text to chart images[edit]
Freeware IrfanView, (and many other image editors), is useful for adding text to charts and other images. Open a chart in IrfanView. Crop the chart as needed. The smaller the margins, the better for the chart showing up more clearly in Wikipedia articles at smaller sizes. Click on the chart where you want text to begin, and drag a large rectangle box where the text will be inserted. Make it large since text will not extend outside the box. The box lines do not remain after you finish editing the image. After you have drawn a box go to the edit menu, and click on 'insert text'. For ease of use pick left alignment in the dialog box that pops up. This way the text will start at the top left of the large box you drew on the image. Pick your font and color from the dialog box. Then click 'preview' in the dialog box. The text will be inserted temporarily in the large box. The background will not be effected if the background is set to 'transparent' in the dialog box. Change your settings until you get what you want in the preview. Then click 'OK' in the dialog box. Save the image when you are done.
PDF to Excel. Free online tools[edit]
- Google search: convert pdf to excel.
- Convert PDF to Excel Free Online - No email required. This free site works great. Upload PDF. Converts in less than a minute. Download it. 'The new spreadsheet will be in .xlsx format ready to use in Microsoft Excel (versions 7, 10, 13), LibreCalc, OpenCalc or any other office suite compatible with MS Office.'
PDF table to LibreOffice Calc to wikitext[edit]
- See a slightly different way here: en:User:Timeshifter/Sandbox81. See: Convert PDF to Excel Free Online - No email required. This free site works great. Upload PDF. Converts in less than a minute. Download it. Open it with freeware LibreOffice Calc.
Some tables in PDF files can be copied directly into LibreOffice Calc. For example; the table on page 2 of this CBO PDF that summarizes the net effects of the Tax Cuts and Jobs Act of 2017. Copy and paste the table into a new spreadsheet in LibreOffice Calc. Save in the default .ods format (OpenDocument spreadsheet).
Once saved follow the relevant instructions in the section higher up called 'Web to LibreOffice Calc to tab2wiki'. In LibreOffice Calc you can keep the commas in the numbers, and not have a decimal point, by going to: format menu > cells > numbers tab > category - number > decimal places - 0 > thousands separator > OK. Then copy and paste the table into tab2wiki.
Adjust the headings and add styling, as necessary:
Millions of Dollars. | |||||
Income Category | 2019 | 2021 | 2023 | 2025 | 2027 |
---|---|---|---|---|---|
Less than $10,000 | 1,530 | 5,890 | 7,540 | 8,790 | 10,120 |
$10,000 to $20,000 | 150 | 8,120 | 10,700 | 11,320 | 16,290 |
$20,000 to $30,000 | -1,090 | 7,910 | 9,440 | 11,430 | 17,100 |
$30,000 to $40,000 | -4,770 | 310 | 2,490 | 2,840 | 7,850 |
$40,000 to $50,000 | -6,450 | -2,590 | -1,240 | -590 | 5,510 |
$50,000 to $75,000 | -23,050 | -18,760 | -14,910 | -14,380 | 4,030 |
$75,000 to $100,000 | -22,580 | -21,030 | -17,090 | -17,240 | -1,720 |
$100,000 to $200,000 | -70,690 | -65,880 | -50,780 | -49,790 | -7,600 |
$200,000 to $500,000 | -65,650 | -62,040 | -47,250 | -48,140 | -6,680 |
$500,000 to $1,000,000 | -23,990 | -21,800 | -14,180 | -13,790 | -3,300 |
$1,000,000 and over | -36,940 | -30,130 | -10,160 | -9,960 | -8,920 |
Total, All Taxpayers | -253,500 | -200,000 | -125,440 | -119,500 | 32,690 |
PDF to HTML, wikitext[edit]
Convert PDF charts and graphs to wikitext, or to HTML.
Some PDF charts can be converted to HTML charts. Copying and pasting some PDF charts produces comma-separated values (CSV) when pasted into some freeware text editors such as Notetab Light. See the next section for tools to convert CSV data into HTML charts and wikitext charts.
Sometimes you can paste a PDF chart into a Kompozer page. After doing so, select the chart text on the Kompozer page. Then click 'create table from selection' in the table menu. Choose between commas or spaces (depending on what was used) to separate the columns. Save the page as an HTML web page. Then use one of the HTML to wiki converters to convert the HTML chart to wikitext.
PDF tools[edit]
Some of the previous sections refer to PDF files. Wikipedia has a comprehensive list of PDF software. Much of it is free and open source.
Ldap query tool for mac. CNET has a category: PDF Software Downloads for Windows. Much of it is free, or free to try. Click 'free' link in the left sidebar for freeware. Initial sort is by downloads last week. Recent popularity is usually a good comparative guide to ease of use.
Appropedia has notes on porting PDF files to MediaWiki.
For tables and charts, converting PDF to SVG is usually the optimal choice if you have the skills and tools to do so. Two programs that can do this are:
Convert wiki tables to Excel[edit]
Maybe you need to work on some tables, and prefer to work in Excel. See:
Convert Excel to CSV[edit]
Convert xls, xlsx, etc. to CSV. CSV files create clean tables since CSV contains only values, headers, rows, and columns. No other formatting. So they are great for converting to clean wikitext tables.
Online tools[edit]
- Xls, xlsx, and many other file formats can be converted to other formats at zamzar.com. Upload the file, or paste in the URL of the file at zamzar.com/url, and the converted file will be emailed to you. It arrives fast (almost instantly) for small files. For an example see en:User:Timeshifter/Sandbox44.
Convert CSV, DSV, or Excel to HTML or wikitext[edit]
Convert Excel, comma-separated values (CSV), tab-separated values, delimiter-separated values (DSV), etc. to table wiki code.
- de:Wikipedia:Technik/Text/Basic/EXCEL-Tabellenumwandlung/en. The page is in English. Published in German Wikipedia project.
- A free opensource tool to convert Excel and CSV files to wiki table format: csv2other.
Online tools[edit]
- CSV Converter (csv2wp) - converts many types of spreadsheet tables, comma-separated values (CSV), tab-separated values, etc. to wiki code or HTML. You can use this to convert tables from Excel and more. More info in English: de:Benutzer:Duesentrieb/csv2wp_(en). For an example see en:User:Timeshifter/Sandbox44.
Microsoft Word to wiki code[edit]
Excel Wikipedia In Hindi
Microsoft Word converters. See:
This particular set of regular expressions only works for compact tables where there are rows of wikitext using double bars || to separate cells. The country names must be in the first column. Also, this find-and-replace must be done before other formatting of those first cells in rows. Such as a text-align style.
See this Stack Overflow discussion with examples and pictures. Look especially at the screenshot of the settings while doing the find-and-replace. See the answer by Erutan409. It explains how to instantly add [[wikitext brackets]] around all the country names. The example below is for freeware Notepad++. It has Unicode capability, and will work with more languages. The regex code below has also been successfully used in another freeware program, NoteTab Light. It does not have Unicode capability.
Copy the table wikitext to a Notepad++ page. Go to: Search menu, Replace. Check the boxes for 'regular expression' and 'wrap around' and 'down'. Click the mouse cursor at the top of the table wikitext so that all the country names going down the page have brackets added. Copy this regular expression (regex) code to the find and replace forms:
^.*?|h*K(.*?)(?=h*|)
replace with[[$1]]
Then click 'Replace all'. Just clicking 'Replace' one at a time may not work.
Brackets are added around both ends of country names, including country names consisting of more than one word. It only does this in the first cell of each row. In other words the country names before the first set of double bars in the wikitext for tables in the compact format (one line per table row). This is very useful in Wikipedia tables since it saves a lot of time versus manually linking a couple hundred country names. Some names may be red-linked. They need redirects to the main country name.
The redirects save much time later when updating the table since the redirects only need to be done once. Redirects are kept as long as they are in use somewhere on Wikipedia. Keep a user sandbox just for this particular table update. Don't overwrite it. That way a 'What links here' search will find that the redirects are in use, and so the redirects are less likely to be deleted. Leave a note in the edit summary as you create the redirect. Something like 'Please do do not delete this redirect. It is used when updating a table.'
Link and add flags. Long or compact table wikitext[edit]
- This works with compact or long table wikitext. Single or double bars between cells.
- Note:en:User:PrimeHunter (Talk) provided the code.
- Note: In editing preferences check the box: 'enable the editing toolbar. This is sometimes called the '2010 wikitext editor'.'
Make sure the countries are in the first column. The regular expression wraps all the text in the first cell of each row with the {{Flaglist}} template. {{flaglist|Country name}}
. So do this before adding any styling to the first column.
Click on the wikitext source editing link. Click on 'Advanced' in the editing toolbar. Then click on the search and replace icon on the right. Put a check in the box called 'Treat search string as a regular expression.' Fill in the 'Search for' box with (|-.*n|s*)([^|n]*)
. Fill in the 'replace with' box with $1{{flaglist|$2}}
. Then click 'Replace all'. Nearly all countries will be linked and will have flags.
For the red links create redirects as necessary. Save this table permanently in a user sandbox (without overwriting it) so that the redirects are kept due to being in use. Otherwise, admins will delete unused redirects, and you will have to do this tedious, time-consuming redirect task every time you fully update the table. In the edit summary of such redirects, add something like this: 'Please do not delete this redirect. It is sometimes used in updates of [[NAME OF ARTICLE WITH TABLE]].'
Align cell data to right of cells[edit]
Add style=text-align:right
to the top of the table wikitext.
For example:
{| border=1 style=text-align:right
Align country names to left of cells[edit]
Excel Wikipedia
Add style=text-align:left
to each country name cell. Or align=left
Symantec endpoint protection 14 for mac free download. If there are flag templates this is very easy to do. Replace {{
with:
align=left|{{
If there are no flag templates it can be done quickly in many text editors by finding and replacing wikitext all at once. Note the pattern below:
In freeware NoteTab Light replace |-^p|[[
with |-^p| style=text-align:left | [[
Contexts 3 6 2 – fast window switcher panel. ^p is the NoteTab code for line breaks. Click 'replace all' to end up with:
If there are no links other than country links in the table then just replace [[
with style=text-align:left | [[
Conversion examples. Sandboxes for updating tables.[edit]
Return to top. See: User:Timeshifter/Sandbox110 for the short version of instructions to update a table.
User sandboxes with info for updating tables with country lists. Most examples use the Visual Editor at some point. So be sure it is not disabled in preferences. On the Wikimedia Commons you may need to enable it. Do so here: Special:Preferences#mw-prefsection-betafeatures.
- COVID-19 pandemic death rates by country. See: User:Timeshifter/Sandbox107.
- Estimated number of civilian guns per capita by country. See: User:Timeshifter/Sandbox81.
- List of countries by incarceration rate. See: User:Timeshifter/Sandbox98.
- Iraq Body Count project. See: User:Timeshifter/Sandbox106.
From Help:Table: Sandboxes help a lot. For example; your user page: Special:MyPage. Create and bookmark some personal sandboxes too. Visual Editor will load very fast in empty sandboxes: Special:MyPage/Sandbox, Special:MyPage/Sandbox2, Special:MyPage/Sandbox3. As many as you want. Share the link when asking for help. To find all your sandboxes: Special:PrefixIndex/User: – click link, add user name to the spot labeled 'Display pages with prefix:'.
Conversion. List of countries by incarceration rate[edit]
See: List of countries by incarceration rate. And the how-to info here: w:User:Timeshifter/Sandbox98. And: w:User:Timeshifter/Sandbox79 (older method).
LibreOffice Calc and Visual Editor[edit]
Full rapid update of List of countries by incarceration rate.
w:User:Timeshifter/Sandbox98 has an easier method, and there is less need for LibreOffice Calc. See en:Help:Table and its section on the WP:Visual Editor.
See also: w:User:Timeshifter/Sandbox79. It has a table, and instructions on how to create it using freeware LibreOffice Calc and Visual Editor.
Please do not delete the country redirects. This allows the table to be fully updated much more often. It only takes half an hour to fully update the table if redirects do not also have to be recreated each time (which can take hours). The source page uses these country, territory, and subnational names.
Alternative older method[edit]
For an example see: w:User:Timeshifter/Sandbox74.
This is an alternative method to using LibreOffice Calc, tab2wiki, and/or Visual Editor as discussed on this page, or elsewhere. Sometimes alternatives are required. That is why this info has been kept below, even though LibreOffice Calc and Visual Editor will work for this particular table.
See the long table at en:List of countries by incarceration rate. It has over 200 rows. It is too difficult to maintain the table in highest to lowest order. That order can change with a single country update by any random editor. Plus one gets highest to lowest order by clicking the rate header. Alphabetical order is easy to maintain, because it is not affected by multiple small changes in the stats. To add row numbering see en:Help sorting.
Source: Highest to Lowest. World Prison Brief. International Centre for Prison Studies. Use dropdown menu to choose lists of countries by region, or the whole world. Use menu to select highest-to-lowest lists of prison population totals, prison population rates, percentage of pre-trial detainees / remand prisoners, percentage of female prisoners, percentage of foreign prisoners, and occupancy rate. Column headings in tables can be clicked to reorder columns lowest to highest, or alphabetically.
Use the menus to create a whole world list of prison population rates. Then click on the country column to put it in alphabetical order. Then copy and paste it into an online HTML WYSIWYG editor such as this one:
- HTML EDITOR.in: Free Online WYSIWYG HTML and HTML5 Editor. To get the one just for your browser click on the link: 'To use TinyMCE editor Click here'.
Click inside the editing area. To paste in the table use the edit menu of your browser, and then click 'paste'. After pasting in the table remove the rank column. To do this click anywhere in the rank column. Then click on the toolbar button that says (tooltip) 'remove column'. Then go into source mode to get the HTML. The table HTML starts with and ends with .
There are many free HTML editors that can remove table columns, and do other table editing. For example; KompoZer. Place cursor in column heading. Then; table menu, delete column. You can also select all, right click, and 'remove all text styles'.
Copy only the table HTML, and paste it into the 'HTML markup' form of the online HTML to Wiki Converter hosted by Magnus Manske. It is here. Click 'convert' at the bottom of the converter page. It converts the table HTML to wiki code (wikitext). Paste it into a sandbox or one of your user pages (or subpages) to see what it looks like as a MediaWiki table.
The wikitext needs to be cleaned up. To do so quickly, copy the wikitext into a blank page of a good free text editor such as NoteTab Light. Save this as a text file. Remove the CSS styling at the top of the table wikitext. It is unnecessary. Then use the text editor's find-and-replace tool to remove all the classes. Replace double spaces with single spaces. Repeat until no double spaces remain. Fix any text laddering. Some of it can be done with find-and-replace. For example; replace with . Save the text file.
Country (or dependent territory, subnational area, etc.) | Incarceration rate (Prisoners per 100,000 population) |
---|
First replace with nothing.
Then remove the rest of the HTML used for the country links. Put a checkmark in the regular expression checkbox, and then remove everything between HTML tag brackets: <>
Pubg emulator download for mac. To do that paste this regular expression in the 'find what' line:
- <.*?>
In the 'replace with' line put this:
- style='text-align:left' |
Click 'replace all.' This instantly removes nearly all HTML code. It replaces it with styling that aligns the country names to the left. The names are easier to read that way.
Adding country links and flags[edit]
Alternatively, you can add country linking and flag icons (see: en:Template:Flaglist). To do so replace with template end brackets: }} Then replace the remaining HTML using the regular expression method. Put a checkmark in the regular expression checkbox, and then remove and replace everything between HTML tag brackets <>
Those 2 changes should make all the country names into wikilinks, and adds flag icons in front of them. It also aligns the country text to the left. For example; see en:User:Timeshifter/Sandbox42. In some country lists created this way some of the country links may have to be created manually. This is because there is a need to create redirects to the country names used for these links. Fortunately, nearly all the redirects have been created for this country list. For the combined UK number for England and Wales add this manually to keep both flags:
Also add this for Sint Maarten:
For more info see: en:Wikipedia:WikiProject Flag Template, en:Category:Country data templates and en:Category:Country data redirects. Country links and flag icons are not absolutely necessary in country lists. Timely updating of the list is more important. If you want flags and country links, and you want to be able to rapidly update a list you may need to create some redirects. To do so search here for the templates to redirect to. Add the country or territory name to the search. |
Do some additional manual cleaning, if necessary, to get rid of the rest of the HTML. There shouldn't be a need to do so for en:List of countries by incarceration rate.
Adding a column for notes[edit]
A column for notes (if necessary) is instantly added by adding another column with the Visual Editor (VE). See the VE section of Help:Table.
Another fast method is doing a regular find-and-replace. In NoteTab Light replace
- |-
- with
- |^p|-
- ^p is the NoteTab code for line breaks.
- |- is the wikitext for a table row.
- | is the wikitext for a table cell. See meta:Help:Table.
For consistency use the same reference for all the countries and territories possible. That reference link is placed above the table. If rates for additional countries or territories are found they can be entered in the table, and info about the sources can be put in the notes section below the table.
Do not put references or long notes in the table. They will break the alignment of the row numbering. See en:Help:Sorting sections about row numbering. Point to the notes section below the table. For example; see List of countries by incarceration rate.
PDF to image files[edit]
See: Commons:PDF to image files
Add text to chart images[edit]
Freeware IrfanView, (and many other image editors), is useful for adding text to charts and other images. Open a chart in IrfanView. Crop the chart as needed. The smaller the margins, the better for the chart showing up more clearly in Wikipedia articles at smaller sizes. Click on the chart where you want text to begin, and drag a large rectangle box where the text will be inserted. Make it large since text will not extend outside the box. The box lines do not remain after you finish editing the image. After you have drawn a box go to the edit menu, and click on 'insert text'. For ease of use pick left alignment in the dialog box that pops up. This way the text will start at the top left of the large box you drew on the image. Pick your font and color from the dialog box. Then click 'preview' in the dialog box. The text will be inserted temporarily in the large box. The background will not be effected if the background is set to 'transparent' in the dialog box. Change your settings until you get what you want in the preview. Then click 'OK' in the dialog box. Save the image when you are done.
PDF to Excel. Free online tools[edit]
- Google search: convert pdf to excel.
- Convert PDF to Excel Free Online - No email required. This free site works great. Upload PDF. Converts in less than a minute. Download it. 'The new spreadsheet will be in .xlsx format ready to use in Microsoft Excel (versions 7, 10, 13), LibreCalc, OpenCalc or any other office suite compatible with MS Office.'
PDF table to LibreOffice Calc to wikitext[edit]
- See a slightly different way here: en:User:Timeshifter/Sandbox81. See: Convert PDF to Excel Free Online - No email required. This free site works great. Upload PDF. Converts in less than a minute. Download it. Open it with freeware LibreOffice Calc.
Some tables in PDF files can be copied directly into LibreOffice Calc. For example; the table on page 2 of this CBO PDF that summarizes the net effects of the Tax Cuts and Jobs Act of 2017. Copy and paste the table into a new spreadsheet in LibreOffice Calc. Save in the default .ods format (OpenDocument spreadsheet).
Once saved follow the relevant instructions in the section higher up called 'Web to LibreOffice Calc to tab2wiki'. In LibreOffice Calc you can keep the commas in the numbers, and not have a decimal point, by going to: format menu > cells > numbers tab > category - number > decimal places - 0 > thousands separator > OK. Then copy and paste the table into tab2wiki.
Adjust the headings and add styling, as necessary:
Millions of Dollars. | |||||
Income Category | 2019 | 2021 | 2023 | 2025 | 2027 |
---|---|---|---|---|---|
Less than $10,000 | 1,530 | 5,890 | 7,540 | 8,790 | 10,120 |
$10,000 to $20,000 | 150 | 8,120 | 10,700 | 11,320 | 16,290 |
$20,000 to $30,000 | -1,090 | 7,910 | 9,440 | 11,430 | 17,100 |
$30,000 to $40,000 | -4,770 | 310 | 2,490 | 2,840 | 7,850 |
$40,000 to $50,000 | -6,450 | -2,590 | -1,240 | -590 | 5,510 |
$50,000 to $75,000 | -23,050 | -18,760 | -14,910 | -14,380 | 4,030 |
$75,000 to $100,000 | -22,580 | -21,030 | -17,090 | -17,240 | -1,720 |
$100,000 to $200,000 | -70,690 | -65,880 | -50,780 | -49,790 | -7,600 |
$200,000 to $500,000 | -65,650 | -62,040 | -47,250 | -48,140 | -6,680 |
$500,000 to $1,000,000 | -23,990 | -21,800 | -14,180 | -13,790 | -3,300 |
$1,000,000 and over | -36,940 | -30,130 | -10,160 | -9,960 | -8,920 |
Total, All Taxpayers | -253,500 | -200,000 | -125,440 | -119,500 | 32,690 |
PDF to HTML, wikitext[edit]
Convert PDF charts and graphs to wikitext, or to HTML.
Some PDF charts can be converted to HTML charts. Copying and pasting some PDF charts produces comma-separated values (CSV) when pasted into some freeware text editors such as Notetab Light. See the next section for tools to convert CSV data into HTML charts and wikitext charts.
Sometimes you can paste a PDF chart into a Kompozer page. After doing so, select the chart text on the Kompozer page. Then click 'create table from selection' in the table menu. Choose between commas or spaces (depending on what was used) to separate the columns. Save the page as an HTML web page. Then use one of the HTML to wiki converters to convert the HTML chart to wikitext.
PDF tools[edit]
Some of the previous sections refer to PDF files. Wikipedia has a comprehensive list of PDF software. Much of it is free and open source.
Ldap query tool for mac. CNET has a category: PDF Software Downloads for Windows. Much of it is free, or free to try. Click 'free' link in the left sidebar for freeware. Initial sort is by downloads last week. Recent popularity is usually a good comparative guide to ease of use.
Appropedia has notes on porting PDF files to MediaWiki.
For tables and charts, converting PDF to SVG is usually the optimal choice if you have the skills and tools to do so. Two programs that can do this are:
Convert wiki tables to Excel[edit]
Maybe you need to work on some tables, and prefer to work in Excel. See:
Convert Excel to CSV[edit]
Convert xls, xlsx, etc. to CSV. CSV files create clean tables since CSV contains only values, headers, rows, and columns. No other formatting. So they are great for converting to clean wikitext tables.
Online tools[edit]
- Xls, xlsx, and many other file formats can be converted to other formats at zamzar.com. Upload the file, or paste in the URL of the file at zamzar.com/url, and the converted file will be emailed to you. It arrives fast (almost instantly) for small files. For an example see en:User:Timeshifter/Sandbox44.
Convert CSV, DSV, or Excel to HTML or wikitext[edit]
Convert Excel, comma-separated values (CSV), tab-separated values, delimiter-separated values (DSV), etc. to table wiki code.
- de:Wikipedia:Technik/Text/Basic/EXCEL-Tabellenumwandlung/en. The page is in English. Published in German Wikipedia project.
- A free opensource tool to convert Excel and CSV files to wiki table format: csv2other.
Online tools[edit]
- CSV Converter (csv2wp) - converts many types of spreadsheet tables, comma-separated values (CSV), tab-separated values, etc. to wiki code or HTML. You can use this to convert tables from Excel and more. More info in English: de:Benutzer:Duesentrieb/csv2wp_(en). For an example see en:User:Timeshifter/Sandbox44.
Microsoft Word to wiki code[edit]
Excel Wikipedia In Hindi
Microsoft Word converters. See:
Print screen, and then edit chart image[edit]
The charts can be converted to images by using the 'Print Screen' key on a keyboard. Image editors can then be used to capture and crop the chart found on the screenshot.
There are many free image editors. See:
For example; there is the free, popular, easy-to-use Irfanview. Use it to resize charts, remove watermarks, crop unused space from around the edges, and so on. Irfanview can also losslessly compress PNG images so as to use less kilobytes for the same image without any loss in image quality. Install the Irfanview plugin pack too. It installs instantly and includes even better PNG compression, PNGOUT, which is easy to use in Irfanview.
Remove flags from tables for use outside Wikipedia[edit]
Excel Wikipedia Romana
Copy the list table from the reader view of a Wikipedia page (not from wikitext). Paste into tab2wiki. This removes the flags, and leaves the full country names. This is very helpful when dealing with flag templates that use acronyms for countries.
Excel Wikipedia Na Bosanskom Jeziku
This works for many HTML tables (from any site) where you want to remove flags and other graphics.