For example with Python, using Pandas:
import pandas as pd
data = pd.from_excel("path_to.xls", sheetname="sheet1")
(As simple as that.)
Pandas can read and write from/to more formats.
However, for typical tabular data CSV is the best option for open data.
I've not done this myself, but the US Census does provide datasets and information for mapping census data between 2010 and 2000. They call these the geography relationship files. Below is a link to the datasets/information.
This is an excerpt from their website that I think would apply to your ...
I don't believe that you will find a "ready" library that will be the case for all your excel files. My advice is to create a script by yourself in base of your file structures. Especially if the updates will still have the same structure.
I cannot help you in PHP, but in Python you can find an answer for what you need here: A Python guide for open data ...
You may want to look at this previous stackoverflow question on converting Excel to CSV in batch mode on Linux. Once it is in CSV, you have lots of options of converting to other formats - but CSV is the most common format for open datasets
I received some help on it. Something along these lines with xor in Python did the job:
with open('...dat', 'rb') as f:
with open('...txt', 'w') as out:
xor = 1
s = ""
c = f.read(1)
if c == "" or len(c) == 0:
c = chr(ord(c) ^ xor)
s += str(c)
I assume that your are talking about the 5-star Open Data from Tim-Berners Lee.
In this case, you can check this one about working with different kind of file types in Python.
3 star data is CSV and 4 star data is RDF.
From the linked answer:
Comma Separated Files (CSV) files can be a very useful format, because it is compact and thus suitable to ...
That sounds like you'll do fine with a CSV format. (Assuming the datasets are not too large.)
The problem, as pointed out before, is that you may have to design a process for each format/version etc of Excel sheet. They are optimised for human-readability, not machines.
You can use your tool of your choice to convert them, but there will be some manual ...
nces data are generally complex sample survey data, which means you'll eventually need a statistical package (sas, spss, stata, or R) to work with the microdata correctly. R is the only free option here, and you can load the ascii file directly into R with the SAScii package. good luck!
install.packages("SAScii") # if it is not already installed.
I'd use Perl, I know there is a CPAN lib for that ant your webserver may also be able to use Perl out of the box.
Search for it and you're done. Easier is Spreadsheet::Read + JSON::XS.
It will end up in a code looking like
$json = JSON::XS->new->ascii;
On the understanding that I do work for this company, I'll mention a product called FME that is capable of converting Excel into any of several hundred formats. It's a commercial (i.e. non-open) product, but does support many open formats of data.
There is also a special website section on FME and Open Data Initiatives
Since I work for them I won't go into ...
simpleexcelphplibrary is the answer you seek:
JSON!!!!!!!!!, HTML, CSV, and XML
seriously just github search this if you want/need more. there are so many conversion scripts its ridiculous. you could do the same with npm, but that's not php...i know codeplex (ms) has a php/excel library. also ...
Yes, ogr2ogr does this job efficiently. Install, GDAL/OGR then run below command.
ogr2ogr -f GeoJSON target.geojson geoRSS.xml
(here target.geojson is the geojson file to be generated, while geoRSS.xml is actual feed file. You need to download it before you run above command.)
I agree with other answers but I also think that the first question would be : who is going to use those data ? If it's just for consultation html or csv seems great but if you want them to be re-use by developers, in ways you just don't know yet, maybe RDF gives more flexibility. If your data will just be download by big companies people, .xls or .xlsx will ...
This is indeed a common question! First step should consider what your aim and your audience is.
At the ODI we believe that good open data goes beyond technical standards when publishing. That's why we have build the Open Data Certificates. More on the about page.
It covers four areas:
if you want to publish it on the web, publish it in .html, so it works on the web, aka web platform.
best course of action here is to have .json that you render in .html in the document, but also will render to .csv/.xls//.xlsx/.etc on the fly, for users to download