# Split table

**URL:** <https://forum.knime.com/t/split-table/80762>\
**Category:** KNIME Analytics Platform\
**Created:** [June 28, 2024, 9:49am UTC](https://forum.knime.com/t/split-table/80762 "2024-06-28T09:49:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nguyen\_Huynh\_Du](https://forum-cdn.knime.com/user_avatar/forum.knime.com/nguyen_huynh_du/32/68844_2.png) [@Nguyen\_Huynh\_Du](https://forum.knime.com/u/Nguyen_Huynh_Du)\
**Post date:** [June 28, 2024, 9:49am UTC](https://forum.knime.com/t/split-table/80762/1 "2024-06-28T09:49:54Z")

</div>

Hi everyone,

I have a table like this. My problem is, to split this table into many small parts. The rule to split, based on the number I want.

For example, I want to split it into 6 parts. Then, I will based on the total row in the table, and split it into 6 parts equally (if it is odd numbers, it’s ok for unequal tables). My real data also have column No., maybe someone can utilize it.

Thank you everyone.

 ![image](https://forum-cdn.knime.com/uploads/default/original/3X/f/1/f13e2d1381a9f097bd6bd8d32fbe0003870956eb.png)

---

<div class="post-metadata">

**Author:** ![takbb](https://forum-cdn.knime.com/user_avatar/forum.knime.com/takbb/32/57077_2.png) [@takbb](https://forum.knime.com/u/takbb)\
**Post date:** [June 28, 2024, 11:10am UTC](https://forum.knime.com/t/split-table/80762/2 "2024-06-28T11:10:27Z")

</div>

Hi @Nguyen_Huynh_Du , how are you intending to use the different tables afterwards? If you are wanting to just write them out to different files then it can be done in a loop, and we could show how to do that.

If you are wanting n different table viewers, though, where n is a dynamic number determined at run time, then this becomes problematic since each viewer is a different “branch” (presumably with some kind of calculated row filter/splitter with variables defining the splits) and you cannot generate branches dynamically “on the fly”.

Is there any upper limit to the number of different tables you might have (e.g. at most 3 tables, 10 tables, something reasonably manageable?)?

---

<div class="post-metadata">

**Author:** ![takbb](https://forum-cdn.knime.com/user_avatar/forum.knime.com/takbb/32/57077_2.png) [@takbb](https://forum.knime.com/u/takbb)\
**Post date:** [June 29, 2024, 12:27pm UTC](https://forum.knime.com/t/split-table/80762/3 "2024-06-29T12:27:13Z")

</div>

Hi @Nguyen_Huynh_Du , I’m not sure what you’ll do with the split tables once they’re split, but take a look at the following workflow

> **[Split tables into separate ports based on row partitioning – takbb](https://hub.knime.com/takbb/spaces/Public/Demo%20Workflows/ComponentDemo/Split%20tables%20into%20separate%20ports%20based%20on%20row%20partitioning~TfAFo2m5W5htb9Dz/current-state)**
>
> Demonstration of Create Partition Column component to split a table up into n partitions, and then chain the Regex Multi Row Splitter to output each "partition…

It uses some components. In the example, it takes a table of 200 rows, and quickly splits it into 40 individual outputs.

The first is a component for marking rows on a table with sequential “partition numbers”, based either on “rows per partition” (variable number of partitions with fixed number of rows) or “number of partitions” (fixed number of partitions, with variable number of rows):

> **[Create Partition Column – takbb](https://hub.knime.com/takbb/spaces/Public/Components/Grouped%20Regex%20Row%20Splitters/Create%20Partition%20Column~KldXipsIpS4EAply/current-state)**
>
> Divides the rows of a table up into "partitions" with a partition identifier for each. The generated id is stored as a string column, although the value is a s…

You can also specify if the row allocation to each partition is “chunk” (e.g. first 10 rows go to first partition) or “rotation” (e.g. first row to partition 1, second row to partition 2… etc)

Once the rows have been marked with partition numbers, you can then use another component:

> **[Partition Row Splitter – takbb](https://hub.knime.com/takbb/spaces/Public/Components/Grouped%20Regex%20Row%20Splitters/Partition%20Row%20Splitter~Wpg7j8GPl4l1KAeu/current-state)**
>
> Splits rows according to groupings based on a partition identifier The input table can contain any number of different values in the partition identifier colum…

This returns the first 10 partitions found on separate output ports, and the remainder on the 11th port. You can chain these row splitters to easily output a large number of partitions on separate data ports.

An alternative to the Partition Row Splitter is this component, which allows you to provide specific regex patterns for each port, should you have other partitioning requirements:

> **[Regex Multi Row Splitter – takbb](https://hub.knime.com/takbb/spaces/Public/Components/Grouped%20Regex%20Row%20Splitters/Regex%20Multi%20Row%20Splitter~JZr253mn1JyBsbXQ/current-state)**
>
> Splits rows according to groupings based on a regex pattern. Up to 10 patterns can be specified, resulting in the first 10 ports containing rows which match th…

As mentioned before though, whether any of this is of use depends on what you are ultimately trying to do.

You may for example want to use the Create Partition Column to generate the “chunks” of rows, based on your “n tables” requirement, and then use a Group Loop to output each of the partitioned sets of rows to individual output files, for onward processing.

---

<div class="post-metadata">

**Author:** ![Nguyen\_Huynh\_Du](https://forum-cdn.knime.com/user_avatar/forum.knime.com/nguyen_huynh_du/32/68844_2.png) [@Nguyen\_Huynh\_Du](https://forum.knime.com/u/Nguyen_Huynh_Du)\
**Post date:** [July 1, 2024, 3:28am UTC](https://forum.knime.com/t/split-table/80762/4 "2024-07-01T03:28:47Z")

</div>

> [@takbb](#):
>
> As mentioned before though, whether any of this is of use depends on what you are ultimately trying to do.
> 
> You may for example want to use the Create Partition Column to generate the “chunks” of rows, based on your “n tables” requirement, and then use a Group Loop to output each of the partitioned sets of rows to individual output files, for onward processing.

Yes @takbb ,

Usually, I want to divide it into 6 parts. And, do you have any example for using the **regex multi row splitter node?**

And, when I used **regex multi row splitter** and **Partition Row Splitter** , I encountered this problem. Can you help me on this please?

![image](https://forum-cdn.knime.com/uploads/default/original/3X/5/2/52e64495abc3982ec5706ff1f0e4d4e4ae1708db.png)

Contains one node with execution failure (MISSING NoOp (Table) #66)

MISSING NoOp (Table) #66: Node can’t be executed - Node “NoOp (Table)” not available from extension “NodePit Power Nodes” (provided by “Philipp Katz, Daniel Esser; [nodepit.com](http://nodepit.com)”; plugin “com.nodepit.noop.plugin” is not installed)

Thank you for helping.

---

<div class="post-metadata">

**Author:** ![takbb](https://forum-cdn.knime.com/user_avatar/forum.knime.com/takbb/32/57077_2.png) [@takbb](https://forum.knime.com/u/takbb)\
**Post date:** [July 1, 2024, 11:41am UTC](https://forum.knime.com/t/split-table/80762/5 "2024-07-01T11:41:55Z")

</div>

Hi @Nguyen_Huynh_Du , the “Noop” node is in the Nodepit powernodes and are available from Nodepit, and the installation instructions are here should you wish to install them:

> **[NodePit Power Nodes — NodePit](https://nodepit.com/product/noop/installation)**
>
> Everything a Pro User Needs!

However, I have updated the components in the sample workflow so that they no longer use the Noop nodes,. I still recommend the powernodes, but they shouldn’t be necessary now to get these components working.

It’s probably best to redownload the demo workflow:

> **[Split tables into separate ports based on row partitioning – takbb](https://hub.knime.com/takbb/spaces/Public/Demo%20Workflows/ComponentDemo/Split%20tables%20into%20separate%20ports%20based%20on%20row%20partitioning~TfAFo2m5W5htb9Dz/current-state)**
>
> Demonstration of Create Partition Column component to split a table up into n partitions, and then chain the Regex Multi Row Splitter to output each "partition…

This should then have the latest versions of the components, or you can manually trigger an update of the components.

Once working, the workflow gives examples of both these “splitter” components, but if you have any queries on how to make them work, let me know.

For background on the origins of the “Regex Multi Row Splitter” component, see this thread:

> [@Group Splitter Node](https://forum.knime.com/t/group-splitter-node/71734/18):
>
> I’ve now removed all the previous components listed earlier in this thread, so apologies to future visitors if that causes some momentary confusion! However… May I present (with ideas, feedback… and the component name wink from @iCFO) @iCFO , genius idea to use interactive view for giving the mapping feedback. Don’t know why I never thought of that slight_smile. I hope you like the result! drum And may this be the dawn of a new age of simplified row splitting and filteri…

---

<div class="post-metadata">

**Author:** ![Nguyen\_Huynh\_Du](https://forum-cdn.knime.com/user_avatar/forum.knime.com/nguyen_huynh_du/32/68844_2.png) [@Nguyen\_Huynh\_Du](https://forum.knime.com/u/Nguyen_Huynh_Du)\
**Post date:** [July 2, 2024, 6:30am UTC](https://forum.knime.com/t/split-table/80762/6 "2024-07-02T06:30:36Z")

</div>

Thank you a lot @takbb

Solved it!

---

<div class="post-metadata">

**Author:** ![system](https://forum-cdn.knime.com/uploads/default/original/1X/ab3ccf34482a0329361734a18199390177204f15.png) [@system](https://forum.knime.com/u/system)\
**Post date:** [July 9, 2024, 6:30am UTC](https://forum.knime.com/t/split-table/80762/7 "2024-07-09T06:30:58Z")

</div>

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
