Your First DataFlush Script

Andrea Mattioli
There is a newer version of this page. You can find it here.

Create an example CSV file

Create a .csv file like the following:

col1;col2
first;second
third;fourth

The first row contains the header with column names, the others are data rows.

Call it source.csv and put it in any directory you want.

Create the script

Now, in the same directory, create the example.script file containing:

#
FROM CSV
fileName: source.csv
headers: true
delimiter: ;
#
TO CSV
fileName: dest.csv
headers: true
delimiter: ,
#
COLUMN col1 => (1) name:dest1
COLUMN col2 => (0) name:dest2

The first section says you will read a CSV file called source.csv, that the first line of the file is a header conatining the column names and the column delimiter is a semicolon.

The second section says you will write on a CSV file called dest.csv, that you want to write a header with column names in it an the column delimiter will be a comma.

The third section contains column specifications. For each column you have:

  • What you will read (on the left of the => symbol)
  • What you will get (on the right of teh => symbol)

The rows starting with the # symbol are comments

Try it


Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.