0
Pentaho - 
Design  : Text file output
Requirement :

- Read values from DB and create a csv file.
- I want to remove the CR & LF from the last line in the generated file.

This empty last line is causing problem while file parsing so I want to get rid of it.

Sample example here :

enter image description here

Test.ktr : https://ufile.io/ug06w This produces output.csv in which last line contains CRLF (contains 3 lines - blank line at the end of file)

input.csv https://ufile.io/lj0tj (To simulate values coming from database, contains 2 lines)

Pralhad
  • 13
  • 5

2 Answers2

0

Put some logic between the Table input and CSV output, for example the Filter step which can remove empty lines.

enter image description here

I cannot tell you more, unless you tell me more about your specific case.

AlainD
  • 6,187
  • 3
  • 17
  • 31
  • Thank you for your response. Can you please see the example I provided above and help me solve the issue. – Pralhad Nov 30 '17 at 10:20
-1

I could solve this using Shell Script component. After generating file I added a post process step to remove the empty line at the end of the file.

There could be other solutions but this fulfilled my requirement.

Thank you.

Pralhad
  • 13
  • 5