DbaScotti commented on issue #6990:
URL: https://github.com/apache/hop/issues/6990#issuecomment-4234852504
If I want to use the calculator I first have to load the file (for example
dummy.xlsx) in the Stream. I have tried "Load file content in memory" for that.
But sadly the result differs from that we were using in pentaho.
Powershell:
# Datei als Byte-Array einlesen
$fileBytes = [System.IO.File]::ReadAllBytes($SourceFile)
# Byte-Array in Base64-String konvertieren
$base64String = [System.Convert]::ToBase64String($fileBytes)
Pentaho:
// Datei einlesen
var fullpath = Filepath.getString() + "\\" + Filename.getString();
file = new Packages.java.io.File(fullpath);
fileInputStream = new Packages.java.io.FileInputStream(file);
var content =
Packages.org.pentaho.di.core.Const.createByteArray(file.length());
fileInputStream.read(content, 0, file.length());
fileInputStream.close();
if (content.indexOf("<") == 0)
{ PARAMETERS = content; }
else
{
var encString = new Packages.java.lang.String(
Packages.org.apache.commons.codec.binary.Base64.encodeBase64(content));
PARAMETERS = encString;
}
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]