Converting XML SpreadSheet to XLSX using Javascript - javascript

I need to convert a XML SpreadSheet to a native Excel file (XLSX), without using MSOffice.
In particular I need to make this conversion using Javascript.
I'm searching for in "StackOverflow" web page and also in google and other portals, but I don't find nothing about it.
The XML SpreadSheet sample file is like this:
enter image description here
On the other hand, I've discovered the "excelcnv.exe" command for conversion between formats, included in MSOffice Excel installation, but just I got to convert from XLS to XLSX, but not from XML SpreadSheet to XLSX...In fact I haven't found any documentation about this "excelcnv.exe" command so I don't know if it is possible this conversion.
Also I've found about some javascript libraries like oxml.js or XLSX but I think this libraries allow create a native excel file from scratch, not convert from input files in XML SpreadSheet format.
Maybe anybody could know how do this using javascript or some javascript library.
Any help will be very welcome :)
Thanks in advance,

You need to change the file extension. From xml to xls.
Then excelcnv will convert correctly.
excelcnv.exe -oice <INPUT> <OUPUT>

Related

How can I implement an Excel custom format with JavaScript?

I'm trying to write JavaScript code that acts like Excel custom formatting: taking a format and applying it to a string/number/etc in a HTML table.
Is there some code or library that'll let me do that? I'm not trying to access Excel files, just copy the custom format functionality.
If you are using nodejs then please use a framwork that can handle the excel operations. With that you can easily manipulate Excel files. There is one here try it:
https://www.npmjs.com/package/exceljs

How to create EXCEL and WORD file using SuiteScript 2.0?

I'm using HTML Suitelet to create Word and Excel, I'm able to create CSV and PDF files but I am unable to create a Word or Excel. How do I do it?
file.create({name:'testinvoice.pdf',fileType:file.Type.PDF, contents:pdffile.getContents()});
Take a look at the file.Type enum in the help center. file.Type.WORD and file.Type.EXCEL are both supported, but your file.Create may be failing because the contents may not be create. I think this stack overflow question will be helpful with creating an XLS file: Create Excel File in NetSuite's SuiteScript

Javascript (Angular Js) exporting Json as excel (with letters in fonts)

I am trying to implement to Json to Excel exporting in javascript. I am using angular js. I was to able to generate Json to CSV but i cant not retain font(bold) and macros in CSV (because its csv).
Is there any opensource in the market for Json to Excel conversion by retaining font colours for the text.
There is an interesting project on github called Excel Builder (.js)
that offers a client-side way of downloading Excel xlsx files and includes options for formatting the Excel spreadsheet.
https://github.com/stephenliberty/excel-builder.js
You may encounter both browser and Excel compatibility issues using this library, but under the right conditions, it may be quite useful.
The demos on github project with less Excel options but less worries about Excel compatibility issues can be found here: ExcellentExport.js
https://github.com/jmaister/excellentexport
The demos seem to hold some promise.
http://excelbuilderjs.com/index.html
If you are using AngularJS, there is ng-csv:
a "Simple directive that turns arrays and objects into downloadable CSV files".

Can any body tell me how to open a FIle with .dat extension in cent os?

In my new Ruby on rails application I want to find the users country code.
So I am using MaxMind GeoIp. when I downloaded the gzip file after gunzip it gives me a GeoIP.dat file and I am stuck here. Can any one help.
If their is a program to open it or some procedure to use it.
Or if any one can suggest me the other way.
As #Kyle pointed out, you can download "human-readable" CSV files instead of binary DAT files. MaxMind's "GeoLite" downloads are here.
The CSV file format is described here.
But note (from the link above):
Due to the large size of geolocation databases, we generally recommend using our binary format with one of our APIs, since they are highly optimized for speed and disk space. On the other hand, if you have a requirement to import the data into a SQL database, the CSV format is recommended.
The APIs are listed here. There is no Javascript API listed, but there are a couple of options for Ruby.
So to answer your question directly: You would not "open" the dat file directly as you would a spreadsheet document. Instead you would write your own program that uses their API to read the dat file, and perform whatever tasks or queries you design it to do. Check out their API documentation for details of how you might get started with that.
.dat is just a file extension. The contents could be anything. Text. Binary data etc...
There is no way anyone could reliably tell you how to open the file.
I would attempt to view the contents of the file from the command line:
less file_name.dat
You can open the file and read line by line in ruby like this:
IO.readlines('file_name.dat').each do |line|
# do something with the line
end
Edit: I think I found the file you're refering to. Why not go here and download a csv version? The .dat version is not in plain text.

How to convert on the client side GPX and KML to JSON format?

How to convert GPX and KML to JSON, is known any client-side solution? Can be detected file format by selecting by one button? I work with MongoDB and I found solution in ruby but i don't want this process on the server. Whether this can be done in javascript?
There's probably multiple solutions. You could just load the XML and then parse it by walking the DOM, but if you use jQuery, you could use this for instance:
http://www.fyneworks.com/jquery/xml-to-json/

Categories

Resources