camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henryk Konsek <hekon...@gmail.com>
Subject Re: Does Camel Bindy supports text files
Date Fri, 22 Jun 2012 13:07:20 GMT
>> I need to process a text file (.txt). So @CsvRecord works for both .txt and
>> .csv files ?

Whenever you talk about processing CSV file and don't mention Stream
[1] component, a unicorn dies. :)

CsvDataFormat csv = new CsvDataFormat();
csv.setDelimiter("|");
// Record represented as List<String> goes to the 'seda:recordQueue'
from("stream:file?fileName=/tmp/mycsv.txt").unmarshal(csv).to("seda:recordQueue");

Unfortunately Stream component works only for streams of lines. As far
as I know it cannot be used to consume stream which records are
separated with some other token.

Best regards.

[1] http://camel.apache.org/stream.html

-- 
Henryk Konsek
http://henryk-konsek.blogspot.com

Mime
View raw message