On 15 Jun., 17:52, Martin Alderson <
eek...@gmail.com> wrote:
> Hi Daniel,
>
> You can eliminate the CSV driver as the problem by trying with the
> text driver instead.
>
That would be a solution as well I'd guess, but ugly, since I'd have
to properly do the formatting by hand.
> The first problem with your snippet is the $sysdate inside ${}. The $
> is not needed again as everything inside the braces is treated as a
> JEXL expression.
>
You're not looking at the output properly, the problem isn't the type
of the $sysdate, it's the fact that the csv driver seems to cut up on
commas regardless of their position.
Run, the following minimum script:
<script connection-id="csv">
${etl.date.now('dd MMM, yyyy')}, ${etl.date.now('dd MMM; yyyy')}
</script>
And the output will be:
"${etl.date.now('dd MMM","yyyy')}","15 Jun; 2010"
You can change the quote character and the separator character to make
it more obvious.
> If removing the $ doesn't fix it, it might be because sysdate is just
> a string as far as scriptella is concerned. You can wrap it in a call
> to etl.date.parse to fix this, i.e.
> <script connection-id="csv">
> ${etl.date.now('yyyyMMdd')}, $
> {etl.date.format(etl.date.parse(sysdate, 'yyyy-MM-dd'),
> 'yyyyMMddHHmmss')}
> </script>
>
That will never work, at least not with the CSV driver. and when using
the TEXT driver, the parse is not needed anyway.
Greets,
-daniel