Skip to content

lukenofurther/xlsx-to-xml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

xlsx-to-xml

This tool is a NodeJS app that converts spreadsheets (currently XLSX files are the only file type supported) into simple XML output.

Here's an example of what it can do. This table

 cat  feline  fish  spot
 dog  canine  bone  fido
 monkey  simian  banana  bubbles

can be converted into this XML:

<row>
    <cell>cat</cell>
    <cell>feline</cell>
    <cell>fish</cell>
    <cell>spot</cell>
</row>
<row>
    <cell>dog</cell>
    <cell>canine</cell>
    <cell>bone</cell>
    <cell>fido</cell>
</row>
<row>
    <cell>monkey</cell>
    <cell>simian</cell>
    <cell>banana</cell>
    <cell>bubbles</cell>
</row>

Row and cell tag names can be customised to whatever you want.

The backend is a NodeJS server that serves the static index.html and its resources. The conversion operations are performed entirely on the front-end, utlising several libraries - namely js-xlsx (https://github.com/SheetJS/js-xlsx) to read the spreadsheet and RactiveJS (https://github.com/ractivejs/ractive) to render the UI.

To install:

  1. Download or clone the latest version.
  2. Install NodeJS (which should include NPM) if you don't have it installed already (https://nodejs.org).
  3. Browse to the folder on the command line and enter "npm install" to download Node dependencies.

To use:

  1. You need to run in a modern browser. So far I've tested in Chrome and Firefox (versions 50 and 43, respectively, at time of writing).
  2. Browse to the folder on the command line and enter "node server.js" to run the app on the default port (8888). To run on a different port include the port number as the second argument to the node command when starting the app (e.g. "node server.js 8889").
  3. A browser should open automatically or open one yourself and browse to the app's URL, which should be shown in the console (http://localhost:8888 if on the default port).
  4. Choose the file you want to convert and the app will process it immediately, outputting each worksheet in its own tab.
  5. Use the conversion settings and other controls to customise the tags and tabs and remove rows from the output.

NOTE: The version of js-xlsx included in this package is a slightly modded version of the latest version from May 2016. The pull request is in the queue (SheetJS/sheetjs#420).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published