Icon

Batch File with External Tool support

<p>Execute a .BAT file using KNIME's External Tool node</p>

URL: Medium: KNIME Batch Processing on Windows and MacOS https://medium.com/p/caacde067bd0
URL: BAT / External Tool - KNIME Forum (90131) https://forum.knime.com/t/execute-bat-file-from-locally-executed-knime-process/90131/2?u=mlauber71

@echo off

REM ====================================================

REM Simple batch script to create a small CSV demo file

REM ====================================================

REM Define output file path (in the same folder as the script)

set "CSV_FILE=%~dp0output.csv"

REM Delete old version if it exists

if exist "%CSV_FILE%" del "%CSV_FILE%"

REM Write CSV header

echo ID,Name,Country,Score > "%CSV_FILE%"

REM Append a few example rows

echo 1,Alice,Germany,87 >> "%CSV_FILE%"

echo 2,Bob,Poland,92 >> "%CSV_FILE%"

echo 3,Chloe,France,76 >> "%CSV_FILE%"

echo 4,David,Italy,88 >> "%CSV_FILE%"

REM Show result

echo Created file: "%CSV_FILE%"

echo.

type "%CSV_FILE%"

REM pause

Medium: KNIME Batch Processing on Windows and MacOS

https://medium.com/p/caacde067bd0

locate and create /data/ folder with absolute paths
Collect Local Metadata
create_csv.bat
External Tool
Empty Table Creator
List Files/Folders
Path to URI
URL to File Path
Table Row to Variable
v_input_file
Java Snippet (simple)
v_output_file_location
Delete Files/Folders
output.csv
CSV Reader
String to Path (Variable)
input.csvjust a dummy file to feed to theextrenal tool
CSV Writer
v_output_file
Java Snippet (simple)
Try (Variable Ports)
Catch Errors (Var Ports)

Nodes

Extensions

Links