Icon

Exercise4

<p><strong>Chapter 7/Exercise 4</strong></p><p>In this workflow, we implement a <em>Table Row to Variable</em> loop to read multiple CSV files at once.</p><p>The folder <em>KBLData/sales</em> contains multiple CSV files containing sales data. Each file represents one column of a larger dataset. We want to read each dataset and append it back into a bigger dataset. We start by manually creating a data table with the column names (represented in the file names that we want to access). Inside the loop body, we process the data row by row to create the individual file path to each file. We collect the intermediate results with the <em>Loop End (Column Append)</em> node.</p><p><strong><em>Note.</em></strong> You can use the List Files/Folders node to generate a list of file paths contained in a selected folder.</p>

Workflow: Chapter 7/Exercise 4


In this workflow, we implement a Table Row to Variable loop to read multiple CSV files at once.

The folder KBLData/sales contains multiple CSV files containing sales data. Each file represents one column of a larger dataset. We want to read each dataset and append it back into a bigger dataset. We start by manually creating a data table with the column names (represented in the file names that we want to access). Inside the loop body, we process the data row by row to create the individual file path to each file. We collect the intermediate results with the Loop End (Column Append) node.

Note. You can use the List Files/Folders node to generate a list of file paths contained in a selected folder.

Create list of files

Loop body

Get file nameone by one
Table Row to Variable Loop Start
Read file usingpath variable
CSV Reader
Append files by columnsinto one bigger table
Loop End (Column Append)
List ofcolumn names
Table Creator
Convert stringto path variable
String to Path (Variable)
Generate file namefor each file
Variable Expression

Nodes

Extensions

Links