Hi!
I've just installed Jacson 0.89 and like to write a .conf
file to substitute an "awk" program that does the
following:
1. adds a header to each file (in the BEGIN rule)
2. adds a footer to each file (in the END rule)
3. according to some rules, modifies the matching lines
(can also add lines)
How can I do this with Jacson?
I'm trying with:
<application>
<jacson>
<filter se:this="PadFilter">
<pre>aaa </pre>
<post>bbb</post>
</filter>
<eval se:this="LoggingEvaluator"/>
<report se:this="ValuePrintingReport">
<section>lines/log/chunk</section>
</report>
</jacson>
</application>
but it is adding "aaa" and "bbb" to the beginning and
ending of each LINE respectively, not to the beginning
and ending of each FILE.
Thanks in advance.
Best Regards,
Jose M Beas
Logged In: YES
user_id=613247
Hello Jose,
thanks for using Jacson.
With the current release, we did not found a solution for your problem.
Attached
you'll find a new version of jacson.jar. Please update your existing installati
on and try something like:
<application>
<jacson>
<filter se:this="HeadPadFilter" ownchunk="false">
<pre>This is the start</pre>
</filter>
<filter se:this="TailPadFilter" ownchunk="true">
<post>:This is the end</post>
</filter>
<eval se:this="LoggingEvaluator"/>
<report se:this="ValuePrintingReport">
<section>lines/log/chunk</section>
</report>
</jacson>
</application>
The Filters used are new. Via the parameter ownchunk you can determine
whether o
r not the text to append or prepend should be used as own chunk or if it
should
be connected to the last or first chunk.
Have a try and please give feedback if it works for you!
Patrick
Jacson-Jar containing Head- and TailPadFilter
Logged In: YES
user_id=613247
Issue closed
The new Filters will be part of the next jacson release.
Logged In: YES
user_id=561641
Dear Patrick,
First of all, excuse me for the delay in my answer.
I've just tried your hint with the attached .jar and it worked
fine.
Just one issue: how can I introduce a '\n' after my "<pre>"?
It's more, how can I introduce any '\n' either in the head or
tail text?
Thanks a lot,
Jose M Beas
Logged In: YES
user_id=561641
Hi, again!
Sorry, I'll answer myself.
<filter se:this="HeadPadFilter" ownchunk="true">
instead of ownchunk="false".
The same works for the TailPadFilter, in your example it was
ownchunk="true" and it worked for me.
Thanks again,
Jose M Beas
Logged In: YES
user_id=613247
HeadPad- and TailPadFilter are included in the new release
Jacson 0.90. Please note that the parameter name has changed
from ownchunk to separatechunk.