Having issue with regex expression in camel.

Solution Verified - Updated -

Issue

  • My Fuse blueprint is reading from CSV. I am trying to filter out lines that does not have any text .i.e. line with just ',' using regex.
<choice id="_choice1">
   <when id="_when1">
      <simple>${body} regex '[a-z].*'</simple>
         <log id="_log1" message="Data --> ${body}"/>
   </when>
   <otherwise id="_otherwise1">
     <log id="_log2" message="otherwise --> ${body}"/>
   </otherwise>
</choice>
  • Data from CSV below.
Textbox1,,,,,,,,,,,,,,,,,,,,,,,,,,,
Report Date  11/05/2016,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,
SiteCode,Site_Description,SiteModulesComplted,
,,,,,,,,,,,,,,,,,,,,,,,,,,,
123,abc,my site, java training,
  • Output
INFO  otherwise --> Textbox1,,,,,,,,,,,,,,,,,,,,,,,,,,,
INFO  otherwise --> Report Date  11/05/2016,,,,,,,,,,,,,,,,,,,,,,,,,,,
INFO  otherwise --> ,,,,,,,,,,,,,,,,,,,,,,,,,,,
INFO  otherwise --> SiteCode,Site_Description,SiteModulesComplted,

Environment

  • Red Hat JBoss Fuse
    • 6.2.1

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.