Filter based on column Index

Hi,

I am faced with a new challenge, for which I still do not find a solution. I’m writing here, hoping you can help me with a hint.
I am reading an excel that contains 800 columns. Both the names of the columns and the total number of columns are variable from one month to another. Regardless of the name or the number of columns, I need to keep in Excel only the first 24 columns, and the last 12. I have to delete the rest. I tried various methods, but I didn’t get the desired result.
Can someone help me with an idea?

Thanks for the answers.

I cannot see the Example, but you can create empty excel with column you just want to keep and use “Table Validation Reference” Node and pass your Real file on top input and new excel in second input (with only columns you wants to keep) and configure the option as you want.

NOTE: This will only work if column names are not changing in first 24 columns or the last 12. Or in case the column you want to keep their names are not changing or if you know the possible names of the columns that can appears in those ranges or you want to keep.

If this is not the answer. It is better you can make sample file and show it.

Another question: Why do you want to use Column Index? Is your excel columns name are changing? Or the range you mentioned doesn’t have fixed column names?

the names of the columns and how to add them are as in the attached file. considering that the same column name is not kept, I need to keep only the last 12 columns of the file.
next month the file will be populated with the column below, and i need to retin only this:
Incasari 01.02 - 28.02.2025
empty_ADW
empty_ADX
empty_ADY
empty_ADZ
Total incasari (#20)
empty_AEB
empty_AEC
Analiza incasari vs update (#22)
empty_AEE
empty_AEF
empty_AEG

I tried the option in which to create a variable that would build at each run the name of the column from which to start reading. I set the variable in excel reader-Flow Variable-settings-read_from_column, but it doesn’t work. is there another option to stay only with these last 12 columns? to retain the first 24 columns, I succeeded.
column-name.xlsx (15.4 KB)


Sample Row Filter.knwf (347.5 KB)

Let me know if this logic helps.

You can try this way as well.

2 Likes

thank you very much! version 2 worked, the one with the picture of the flow

thank you very much! this version worked corectly!

1 Like

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