Writing a csv file has incorrect header quoting

32 views
Skip to first unread message

Peter Kempkers

unread,
Nov 2, 2021, 11:49:42 PM11/2/21
to Scriptella ETL
I'm using the following script:

<!DOCTYPE etl SYSTEM "http://scriptella.org/dtd/etl.dtd">
<etl>

<connection id="in" driver="csv" url="/home/peter/scriptella/scriptella-1.2/report.csv">
    separator=;
    quote='
</connection>

<connection id="out" driver="csv" url="/home/peter/scriptella/scriptella-1.2/report2.csv">
    separator=;
    quote='
</connection>

<script connection-id="out">
    Name; Age
</script>

<query connection-id="in">
    <!--Empty query means select all-->
    <script connection-id="out">
        $name,$age
    </script>
</query>
</etl>

The results look like this

$ sdiff -s report.csv report2.csv
'ID';'Name';'Age'                                         | 'Name; Age'
'1';'Peter';'62'                                              | 'Peter';'62'

So the header is quoting the whole header not the individual fields i.e. 'Name';'Age'

Am I missing something? From my experience the fulling quote header is not correct, and it also doesn't load using Scriptella.

Can this be fixed or is there a work around?

Thanks
Peter

Christian MICHON

unread,
Jan 30, 2022, 1:05:03 PM1/30/22
to Scriptella ETL
Hi Peter,

sorry I missed this message with an easy fix.

When you call the 1st script on connection-id="out", you wrote Name; Age.

Instead use Name,Age like you did later on, with a comma, not a semi-colon.

Rgds
Christian

Reply all
Reply to author
Forward
0 new messages