Skip to content
Mathias Rangel Wulff edited this page Jun 13, 2015 · 6 revisions

Extract, transform and load with AlaSQL

You can use AlaSQL and Alacon for ETL procedures.

Load data from CSV file with headers

If you have a CSV file, you can process it directly in AlaSQL:

    alasql('select * from csv("cities.csv",{headers:true}) where population > 100000 order by city', [],
      function(data) {
         console.log(data);
    });

You can do the same query with Alacon command-line utility and prepare file to stdout:

    node alacon "select * from csv('cities.csv',{headers:true}) where population > 100000 order by city" >city.txt

Prepare data from XLSX and XLS file

    alasql('select * from xlsx("cities.xlsx",{headers:true, range:"A1:E100"})\
      where population > 100000 order by city', [], function(data) {
         console.log(data);
    });
Clone this wiki locally