# Filtering columns with matching headers

**URL:** <https://forum.knime.com/t/filtering-columns-with-matching-headers/5267>\
**Category:** KNIME Extensions\
**Tags:** text-processing\
**Created:** [November 3, 2016, 9:47pm UTC](https://forum.knime.com/t/filtering-columns-with-matching-headers/5267 "2016-11-03T21:47:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vanessa\_030](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/v/ecc23a/32.png) [@Vanessa\_030](https://forum.knime.com/u/Vanessa_030)\
**Post date:** [November 3, 2016, 9:47pm UTC](https://forum.knime.com/t/filtering-columns-with-matching-headers/5267/1 "2016-11-03T21:47:42Z")

</div>

Hi Everybody,

&nbsp;

I have the following problem:

&nbsp;

I got a table A&nbsp;with about 100 different column headers and another table B&nbsp;with about 600 different table headers. Now I need something&nbsp;like the functionality of the reference column filter:

So I need just the columns of table B which also exists in table A. The fact is that not the whole column should be the same but just the columns with the same header.

To make it clear...

examle:

Table A:

| A | B | C | D | E | F | G | H | I | J | K | L | M | N | O |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 |
| 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 |

Table B:

| A | G | Z | X | F | P | G | H | Y | S | T | L | M | V | U |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 | 1 | 1 | 1 | 0 | 0 | 0 |
| 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 |
| 0 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 | 0 | 1 |
| 1 | 1 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 |

&nbsp;

result:

| A | G | F | G | H | L | M |
| --- | --- | --- | --- | --- | --- | --- |
| 0 | 0 | 1 | 0 | 0 | 1 | 0 |
| 0 | 0 | 0 | 1 | 1 | 1 | 0 |
| 0 | 0 | 1 | 1 | 0 | 0 | 1 |
| 1 | 1 | 0 | 1 | 1 | 1 | 0 |

&nbsp;

Can anybody help me?

&nbsp;

Cheers,

&nbsp;

Vanessa

---

<div class="post-metadata">

**Author:** ![RolandBurger](https://forum-cdn.knime.com/user_avatar/forum.knime.com/rolandburger/32/51868_2.png) [@RolandBurger](https://forum.knime.com/u/RolandBurger)\
**Post date:** [November 28, 2016, 6:22pm UTC](https://forum.knime.com/t/filtering-columns-with-matching-headers/5267/2 "2016-11-28T18:22:27Z")

</div>

Hi Vanessa,

The Reference Column Filter node should do exactly what you want to do. It only filters by column name, not by the values of the columns.

Best,

Roland

---

<div class="post-metadata">

**Author:** ![David\_Ko](https://forum-cdn.knime.com/letter_avatar_proxy/v4/letter/d/f9ae1b/32.png) [@David\_Ko](https://forum.knime.com/u/David_Ko)\
**Post date:** [November 28, 2016, 6:34pm UTC](https://forum.knime.com/t/filtering-columns-with-matching-headers/5267/3 "2016-11-28T18:34:44Z")

</div>

Hi

just use the reference column filter node in Manipulations -\> Column -\> Filter -\> Reference Column Filter

&nbsp;

- [filtering\_columns\_with\_matching\_headers.knwf](https://www.knime.com/sites/default/files/filtering_columns_with_matching_headers.knwf)

---

<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:** [June 2, 2023, 9:48pm UTC](https://forum.knime.com/t/filtering-columns-with-matching-headers/5267/4 "2023-06-02T21:48:42Z")

</div>

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