You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2022/05/18 11:24:57 UTC
[camel-kamelets-examples] branch main updated: CAMEL-18118: camel-jbang - Linux terminal scripting using pipes
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets-examples.git
The following commit(s) were added to refs/heads/main by this push:
new 0c59ac1 CAMEL-18118: camel-jbang - Linux terminal scripting using pipes
0c59ac1 is described below
commit 0c59ac186a300a654737bf4e1abc7f7c3091cbf8
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Wed May 18 13:24:49 2022 +0200
CAMEL-18118: camel-jbang - Linux terminal scripting using pipes
---
jbang/pipe/to_csv.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/jbang/pipe/to_csv.java b/jbang/pipe/to_csv.java
index 88d9ad5..8fd7f4a 100755
--- a/jbang/pipe/to_csv.java
+++ b/jbang/pipe/to_csv.java
@@ -6,13 +6,16 @@ import org.apache.camel.builder.RouteBuilder;
public class to_csv extends RouteBuilder {
+ @org.apache.camel.PropertyInject(value = "separator", defaultValue = ",")
+ private String separator;
+
@Override
public void configure() throws Exception {
// read from system:in
from("stream:in")
// aggregate all lines together using comma as separator
.aggregate(constant("true")).completionTimeout(100)
- .aggregationStrategy(AggregationStrategies.string(","))
+ .aggregationStrategy(AggregationStrategies.string(separator))
// append new line to mark end of line
.setBody().simple("${body}\n")
// write to system:out