User:TheDJ/TabularImportExport

TabularImportExport
Screenshot of the export interface of the TabularImportExport Gadget
Description Adds extra options to Tabular data pages to import and export
Author User:TheDJ
Status Stable
First released January 12, 2017; 9 years ago (2017-01-12)
Updated July 7, 2025
    (9 months ago)
Skin support vector-2022, vector, monobook
Source MediaWiki:Gadget-TabularImportExport.js

TabularImportExport is a Gadget for Tabular Data pages on Commons. It provides import and export options from and to Excel and CSV files for these pages. This makes it simpler to edit the data within these types of pages with tools that data editors might be familiar with.

The gadget can be found in the Gadgets section of your preferences. Activate it by checking the option: "Tabular Import/Export: Add CSV and Excel import & export on Data namespace. [documentation / talk] " and then Save your preferences.

Exporting data

Choose "Export to Excel" or "Export to CSV" from the menu or the buttons at the bottom of the page. A file with the results will begin downloading. While both files will have the same data, the Excel file supports localized data dn has additional metadata in its' file-properties corresponding to the metadata of the file, like description, sources and license.

Importing data

Screenshot of the import interface of the TabularImportExport Gadget

It is possible to import data from any CSV or Excel file. In order to do this, click the "Edit source" action. At the top of the editor you will find a "Import file" option. Click the button and select the file you want to import to execute the import. Your imported data should appear in the text editor and you can now save it. Before saving you should check if the licensing and sourcing of the data is correct.

Note: If the Excel file was previously exported from Tabular Data, it will also retrieve the metadata from the file properties. If there was no metadata in the file, it will prefill some metadata values.

  • All data is assumed to be UTF-8
  • The first row is always assumed to be the names of the column headers.
  • For Excel, only the first worksheet will be imported.
  • For Excel, the types of the column are based on the datatypes of the cells.
  • If you have localized data, the Excel export will generate a sheet per language.
  • For CSV, the types of the column are based on the values of the first data row.
  • For CSV, an attempt is made to guess the column delimiter, but comma separated values with double quote escaping is advised.
  • Importing from Tab-separated files (.tsv) and OpenDocument spreadsheet (.ods) files is supported as well, but exporting to them is currently not supported.

Known issues

  • UTF-8 values in the properties of the Excel file might be mangled
  • Localized fields in the export have Notes attached to them. This is to keep track of them being special, and facilitates with reimporting.
Category:Gadget scripts Category:Tabular data
Category:Gadget scripts Category:Tabular data