<!DOCTYPE etl SYSTEM "http://scriptella.javaforge.com/dtd/etl.dtd">
<etl>
    <description>
        Quieries CSV data from from file and store the results in another CSV file.
        Buil-in text driver is used.
    </description>
    <connection id="in" driver="text" url="../bugs-in.csv"/>

    <!--Connection to output as Excel CSV file -->
    <connection id="out" driver="text" url="bugs-out.csv"/>

    <!--Filtered output to another file -->
    <connection id="outFiltered" driver="text" url="bugs-out-filtered.csv"/>

    <script connection-id="out">ID,Priority,Summary,Status</script>
    <script connection-id="outFiltered">id;priority;summary;status</script>
    <query connection-id="in">
        <!--Regular expression which selects lines having 4 comma-separated columns-->
        (.*),(.*),(.*),(.*)
        <!--Outputs all matched lines except the first containing headers-->
        <script connection-id="out" if="rownum>1">$1,$2,$3,$4</script>
    </query>
    <query connection-id="in">
        <!--Select bugs with status open or reopened.
        Unfortunately I don't know how to specify negation,e.g. !closed-->
        ([\s\w]*),([\s\w]*),([\s\w]*),(open|reopened)
        <script connection-id="outFiltered">$1;$2;${column3.replaceAll('"', '""')};$4</script>
        <!-- column3.replaceAll is used to escape quote characters -->
    </query>
</etl>
<!DOCTYPE etl SYSTEM "http://scriptella.javaforge.com/dtd/etl.dtd">
<etl>
    <description>
        Quieries CSV data from from file and store the results in another CSV file.
        Buil-in text driver is used.
    </description>
    <connection id="in" driver="text" url="../bugs-in.csv"/>

    <!--Connection to output as Excel CSV file -->
    <connection id="out" driver="text" url="bugs-out.csv"/>

    <!--Filtered output to another file -->
    <connection id="outFiltered" driver="text" url="bugs-out-filtered.csv"/>

    <script connection-id="out">ID,Priority,Summary,Status</script>
    <script connection-id="outFiltered">id;priority;summary;status</script>
    <query connection-id="in">
        <!--Regular expression which selects lines having 4 comma-separated columns-->
        (.*),(.*),(.*),(.*)
        <!--Outputs all matched lines except the first containing headers-->
        <script connection-id="out" if="rownum>1">$1,$2,$3,$4</script>
    </query>
    <query connection-id="in">
        <!--Select bugs with status without word 'closed' .-->
        <![CDATA[
        ([\s\w]*),([\s\w]*),(.*),((.(?!closed)(?<!closed))*)
        ]]>
        <script connection-id="outFiltered">$1;$2;${column3.replaceAll('"', '""')};$4</script>
        <!-- column3.replaceAll is used to escape quote characters -->
    </query>
</etl>
Add negation regex to sample
Add negation regex to sample