0

I'm now using Spoon from PDI-CE 7.0 under windows 10 to edit transformations.

I never found a convenient way to "paste from clipboard" a multiline String value into simple steps like "Data Grid" or "Generate rows"..

Is there a trick that I'm missing ?

The following options work but are not that convenient :

  • Editing the ktr file manually (!!)
  • Using a Scripting step (UDJC, UDJE, JS, ..) to generate the string value
  • Loading the multiline string from a file using loadFileContent() in a JS step
JulianHarty
  • 3,178
  • 3
  • 32
  • 46
Myobis
  • 1,347
  • 16
  • 27
  • Data Grid has table cell for values and it is not a good choice as text editor. Doesn't worth to input multi-line string there. JS is good enough. Editing ktr file, what if some tags inside of pasted string ? – simar Jun 14 '17 at 14:25
  • In JS steps, we are supposed to code/paste some JS code.. that indeed could generate a multiline String value but that's not that convenient .. There is LoadScriptFromTab(tabName) but it is unfortunately not returning the String from the referenced tab (just loading functions apparently). Can't either use backquotes as in Ecma6 to wrap a pasted multiline text. ... About editing the ktr, I mainly wanted to point out that only the UI doesn't support the multiline paste (as ktr and processing work fine). – Myobis Jun 16 '17 at 09:56

1 Answers1

1

Actual copy paste does work, so table widget does support line breaks, but it is not visible in cell. It looks like draw of multiple lines in table cell is not trivial (base on swt examples). In ktr file, kettle providently replace line breaks with xml entity

So if you enter something like

 hello\r\n
 world\r\n
 \r\n

then you will get in ktr file:

 hello
world


" " -is the entity for break like. If you input such string into https://mothereff.in/html-entities then you will get line break back. So if you want to edit ktr file and enter long string at least use such service to make back-wise operation to get escaped version of string for safety. But look like much easier just use copy paste to input string.

simar
  • 1,782
  • 3
  • 16
  • 33
  • Thank for answering but it apparently doesn't work on my side (on Win10): I copy a multiline text to clipboard then paste it into the target cell of a Data Grid, only the 1st line remains (and also in the ktr). If it would be a multiline result (in a preview table for instance), then it is possible to be copy it correctly to clipboard. – Myobis Jun 16 '17 at 09:43
  • 1
    I think it might have some pitfalls depends on Kettle version (swt version) as well as what line ending is used unix or windows way – simar Jun 16 '17 at 10:18
  • Indeed, it works well with linux style EOLs. So, a conversion of the multiline string might be required but that sounds acceptable for most of my uses ! – Myobis Jun 16 '17 at 14:15
  • It works fine for me Windows10, PDI 7.1, tabs separated values. And I find then in the ktr and in the database repository. – AlainD Jul 02 '17 at 13:47