Friday, 1 August 2014

Convert copy-and-pasted XLS + CSV + HTML Table to JSON in Node or Javscript



I've seen a lot of similar questions but none of the Node.js XML converters have worked for me at all. They've all garbled the data I've inputted and have gotten the parameters completely incorrect.


I'm trying to create something similar to this:


http://ift.tt/1rXV7as


Basically, I want a textarea where a user can paste in spreadsheet data OR data copy-and-pasted from an HTML table and convert it into JSON. Reading XML or CSV files from the filesystem is not necessary, I just want the simplest too that will accept either XML, CSV or HTML table data, recognise how to interpret it and successfully convert it to JSON.


Here's an example of what I mean when I say "Copy and pasted HTML tab data"


"Copy and pasted XML/CSV" gets pasted out like this:



Name Email Topic
Bill foo@bar.com topic1
Mary test@test.com topic2
Jane moo@maa.com topic3


Any suggestions on how to achieve this?


No comments:

Post a Comment