Spaces are ignored in ETL

    This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

    • Spaces are ignored in ETL

      Hello,

      I'm trying to write data from a sql database to a file by etl. The format of the file is already defined.

      It could look like this:

      107000001201407280547201407281407419 0730TEST xxxx

      The space character are important and can not be replaced by other characters.

      I have tryed two things, the first was to write an SQL Statement in the extract. I think everything is right but all space Charakters are removed from the Output. When I use something like "abcdefg" instead of " " it works.

      Then I tryed to Transform the Value with the Groovy Function below.

      abc = (field + " ").substring(0,4)
      return abc

      And it doesn't work.

      When I try

      abc = (Unterbrechungsgrund + "____").substring(0,4)
      return abc

      It works but the result is

      107000001201407280547201407281407419_________0730TEST xxxx

      Can someone help me solve my problem