Jump to content

CSV to Wikitable

From Meta, a Wikimedia project coordination wiki

The CSV to Wikitable converter is a web-based tool that transforms CSV (Comma-Separated Values) data into MediaWiki table markup format. This tool is particularly useful for Wikipedia editors and MediaWiki users who need to convert spreadsheet data into wiki-formatted tables.

Tool URL: https://bambots.brucemyers.com/csv2wikitable.php

Features

[edit]
  • Multiple field separator options
  • Configurable text delimiters
  • Automatic header row detection
  • Column wikilinking capabilities
  • Support for both file upload and direct text input
  • One-click copy to clipboard functionality

Interface Components

[edit]

Field Separator Selection

[edit]

Purpose: Defines the character that separates values in your CSV data.

Available Options:

  • , (comma) – Default CSV format
  • ; (semicolon) – Common in European locales
  • | (pipe) – Alternative delimiter
  • <space> – Space-separated values
  • <tab> – Tab-separated values (TSV)

Usage: Select the delimiter that matches your input data format.

Text Delimiter Selection

[edit]

Purpose: Specifies the character used to enclose text fields that may contain the field separator.

Available Options:

  • " (double quote) – Standard CSV format
  • ' (single quote) – Alternative text enclosure
  • <none> – No text delimiter

Example:

"Smith, John",25,Engineer

With " as text delimiter, "Smith, John" is treated as a single field.

First Row Contains Headings

[edit]

Purpose: Checkbox to indicate whether the first row of your CSV data should be treated as column headers.

Behavior:

  • Checked: First row generates table headers using ! syntax in wikitable.
  • Unchecked: All rows treated as data rows using | syntax.

Example Output:

With headers checked:

{| class="wikitable"
! Name
! Age
|-
| John
| 25
|}

With headers unchecked:

{| class="wikitable" |- | Name | Age |- | John | 25 |}

[edit]

Purpose: Automatically converts specified column values into internal wiki links.

Configuration:

  • Two dropdown menus available
  • Each can be set to columns 1–10
  • Default: No columns selected

Functionality: When a column is designated for wikilinking, each value in that column is wrapped in double square brackets [[]], creating a clickable internal wiki link.

Example:

Input CSV:

Country,Capital,Population
France,Paris,67000000

With column 1 (Country) wikilinked:

{| class="wikitable" ! Country ! Capital ! Population |- | [[France]] | Paris | 67000000 |}

Use Cases:

  • Linking article names to their respective Wikipedia pages
  • Creating navigable references in data tables
  • Connecting related wiki content

Input File (Optional)

[edit]

Purpose: Upload CSV files directly from your computer.

Specifications:

  • Accepts standard CSV file formats
  • Alternative to manual text input
  • File size limits may apply (server-dependent)

Usage:

  1. Click the file input button
  2. Select your CSV file from your file system
  3. File contents will be processed automatically

Note: The interface also mentions support for URLs from *.wmflabs.org domains, suggesting integration with Wikimedia Labs infrastructure.

CSV Rows (Optional)

[edit]

Purpose: Manual text input area for pasting CSV data directly.

Features:

  • Multi-line text area
  • Accepts raw CSV formatted text
  • Alternative to file upload

Usage:

  1. Copy your CSV data from spreadsheet applications (Excel, Google Sheets, etc.)
  2. Paste directly into this text area
  3. Ensure proper formatting matches your selected field separator

Example Input:

Name,Age,Occupation
Alice,30,Developer
Bob,25,Designer
Carol,35,Manager

Wikitable Output

[edit]

Purpose: Displays the converted MediaWiki table markup.

Features:

  • Read-only display area
  • Shows complete wikitable syntax
  • Ready for copy-paste into wiki pages

Output Format: The tool generates standard MediaWiki table syntax:

{| class="wikitable"
! Header 1
! Header 2
|-
| Data 1
| Data 2
|-
| Data 3
| Data 4
|}

Copy Functionality: Use Ctrl+C (Windows/Linux) or Cmd+C (Mac) to copy the generated wikitable. It can then be pasted directly into a MediaWiki editor, maintaining all formatting and structure.

MediaWiki Table Syntax Reference

[edit]

Basic Structure

[edit]
{| class="wikitable"
! Column 1 Header
! Column 2 Header
|-
| Row 1, Cell 1
| Row 1, Cell 2
|-
| Row 2, Cell 1
| Row 2, Cell 2
|}

Syntax Elements

[edit]
Element Description
Table opening tag
class="wikitable" Applies standard Wikipedia table styling
! Header cell
- Row separator
Data cell
} Table closing tag
[edit]
  • Internal links: [[Page Name]]
  • Piped links: [[Page Name|Display Text]]
  • External links: Display Text

Workflow Guide

[edit]

Standard Workflow

[edit]

Prepare Your Data

  1. Ensure CSV data is properly formatted
  2. Identify field separator used
  3. Determine if first row contains headers

Configure Settings

  1. Select appropriate field separator
  2. Choose text delimiter if needed
  3. Check "First row contains headings" if applicable
  4. Set wikilink columns if desired

Input Data

  1. Either upload CSV file OR paste CSV text
  2. Verify data appears correctly

Generate Output

  1. Tool automatically converts input to wikitable format
  2. Review output for accuracy

Copy and Use

  1. Use keyboard shortcut to copy wikitable markup
  2. Paste into MediaWiki editor
  3. Preview and publish

Use Cases

[edit]

Wikipedia Data Tables

[edit]

Converting statistical data, comparison tables, or reference information for Wikipedia articles.

Example: Country population statistics, historical data tables, product comparisons.

Wiki Documentation

[edit]

Creating formatted tables for technical documentation on MediaWiki installations.

Example: API reference tables, configuration parameters, command lists.

Collaborative Content

[edit]

Converting shared spreadsheet data into wiki format for team wikis or knowledge bases.

Example: Project tracking tables, team rosters, resource inventories.

Data Migration

[edit]

Transitioning data from spreadsheet applications to wiki-based platforms.

Best Practices

[edit]

Data Preparation

[edit]

Clean Your Data

  1. Remove unnecessary formatting from source
  2. Ensure consistent delimiter usage
  3. Check for embedded delimiters in text fields

Use Text Delimiters

  1. Apply text delimiters when data contains separator characters
  2. Prevents column misalignment

Structure Headers Clearly

  1. Use descriptive, concise header names
  2. Avoid special characters in headers

Wikilinking Strategy

[edit]

Link Strategically

  1. Only link columns with article-worthy terms
  2. Avoid overlinking common words

Verify Links

  1. Ensure linked pages exist in your wiki
  2. Check for correct capitalization and spelling

Consider Piped Links

  1. For display text different from page name, manually add piped links after conversion

Quality Control

[edit]

Preview Output

  1. Always preview in wiki before publishing
  2. Check table rendering and formatting

Test with Sample Data

  1. Try small dataset first to verify settings
  2. Expand to full dataset once confirmed

Maintain Backup

  1. Keep original CSV data as backup
  2. Allows regeneration if issues occur

Troubleshooting

[edit]

Common Issues

[edit]
Problem
Columns not separating correctly
Solution: Verify correct field separator is selected
Cause: Mismatch between actual and selected delimiter
Problem
Text split across multiple columns
Solution: Select appropriate text delimiter
Cause: Embedded separators in text fields without text delimiters
Problem
Headers appearing as data rows
Solution: Check "First row contains headings" checkbox
Cause: Setting not enabled when headers present
Problem
Wikilinks not appearing
Solution: Verify correct column number selected (1-based indexing)
Cause: Wrong column selected or column out of range
Problem
Table not rendering in wiki
Solution: Check for syntax errors, ensure complete table tags
Cause: Incomplete copy or corrupted markup

Technical Specifications

[edit]

Input Limitations

[edit]
  • Maximum columns supported: At least 10 (based on wikilink options)
  • File upload supported from local storage
  • URL input supported for *.wmflabs.org domains

Output Format

[edit]
  • MediaWiki markup language
  • Standard wikitable class applied
  • Compatible with Wikipedia and MediaWiki installations

Browser Compatibility

[edit]
  • Modern web browsers with JavaScript enabled
  • Clipboard API support for copy functionality
[edit]

MediaWiki Documentation

[edit]

CSV Standards

[edit]

Tools

[edit]
  • Complementary tools for wiki editing
  • CSV validators and formatters
  • MediaWiki syntax checkers

Support and Feedback

[edit]

For issues, questions, or feedback about this tool, refer to the tool's hosting site at bambots.brucemyers.com.