Resorting columns NOT using dictionary order

Hi there.

I’m new to knime and I’m trying to work out how to resort column headers (that begin with numbers) from lowest to highest, however my only sort options are to sort from A-Z, which means that column headers beginning with 10 11 and 12 come before column headers beginning with 2, 3, 4 etc. once sorted. Is there anyway around this?

Obviously I can do this manually, however this can get pretty tedious as the number of numbered columns increases…

Many thanks in advance for any suggestions!

1 Like

Hi @ghodges and welcome to the KNIME forum

Could you please provide some examples of what is the naming of your columns ? Depending on it, the solutions may be different.

Thanks & regards,

Ael

2 Likes

Thank you Ael!

So the columns look something like this, where the first numbers (1-12) represent the month and the 2018 represents the year. A lot of my data sets have columns for multiple years, so it takes a while to sort them manually:

2018_1 Patient Volume A,
2018_2 Patient Volume A,
2018_3 Patient Volume A,
2018_4 Patient Volume A,
2018_5 Patient Volume A,
2018_6 Patient Volume A,
2018_7 Patient Volume A,
2018_8 Patient Volume A,
2018_9 Patient Volume A,
2018_10 Patient Volume A,
2018_11 Patient Volume A,
2018_12 Patient Volume A,

Let me know if you need any further info, many thanks!

1 Like

Hi @ghodges

My pleasure. This workflow below shows a possible solution (May be other simpler solutions exist):

20210930 Pikairos Resorting columns NOT using dictionary order.knwf (74.8 KB)

Hope this helps.

Best

Ael

5 Likes

Hi Ael,

This worked for me, thank you very much! :slight_smile:

2 Likes

Hi @ghodges

Glad it worked and my pleasure :blush: ! Thanks for your feedback and for validating the answer :smiley: :+1:!

Best wishes,

Ael

1 Like

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