Sort lines by prefix number?

britalic

Пользователь
Регистрация
31.07.2012
Сообщения
33
Благодарностей
8
Баллы
8
Hello, I am trying to sort some lines by number but I am failing...maybe it is the wrong approach but I almost did it and then I failed at the LAST step so maybe we need a "sort by prefix" option in table processing?

these are some example lines I have:

9a0421qq127a113b91w16
00201711849281aabui8o
0206601105825ra33abha
2101502164003opc4axba
012924162210a8lb42x5a
260762701312raa2y2haz
300aak3r2110k02080993
2000815118415la0nawfo
8010121524034a2rash2u
21000622121240acob0pa
01203181003244oaa9gz9
1002298080330u69aow8a

These lines are identifiers and NEVER change and I want to give different priority to them.
I put the lines in a table and then I add some (changing) prefixes, the prefixes change as the template progresses, for instance I end up with some priorities like this:

12:8010121524034a2rash2u
2:00201711849281aabui8o
1234:300aak3r2110k02080993
11:2101502164003opc4axba
0:21000622121240acob0pa
0:9a0421qq127a113b91w16
9:1002298080330u69aow8a
4:260762701312raa2y2haz
12:8010121524034a2rash2u
0:21000622121240acob0pa
120:012924162210a8lb42x5a
8:0206601105825ra33abha

for instance the line 1234:300aak3r2110k02080993 has the 1234 at the start and so I want it to be lowest priority and I want it to go to the bottom of the pile.

I then try and put them in numerical order, lowest numbers at the top (I create a list, bind the file to it and then use the "sort" option in list processing) by the prefix hoping for a result like this:

0:9a0421qq127a113b91w16
0:21000622121240acob0pa
0:21000622121240acob0pa
2:00201711849281aabui8o
4:260762701312raa2y2haz
8:0206601105825ra33abha
9:1002298080330u69aow8a
11:2101502164003opc4axba
12:8010121524034a2rash2u
12:8010121524034a2rash2u
120:012924162210a8lb42x5a
1234:300aak3r2110k02080993

and this is where I of course fail.

It is obvious that for the purpose of numerically sorting, the sorting option should only consider "numbers" up to the : and discard what is after.

So how can I do this? Is it even possible?
 

britalic

Пользователь
Регистрация
31.07.2012
Сообщения
33
Благодарностей
8
Баллы
8
of course one way I could try is to put each identifier inside a text file, number the text files in a progressive manner, constantly scrape folders containing files, their names acting as prefixes, create a list with these text file names, and try and sort those. Then to get the identifier I would go to the text file, open it, get the identifier from inside. Maybe it works but there must be a better way to do this. Something like "sort lines by their prefix". Or maybe it already exists and I haven't seen it.
 

britalic

Пользователь
Регистрация
31.07.2012
Сообщения
33
Благодарностей
8
Баллы
8
I actually worked out a way to do this, some frankestein way that took me 50 hours and 2kgs of coffee and some manic workaround not clean code at all but it works and it's only computer time.

I'd love to have a BUTTON that says START FROM LAST EXCUTED ACTION and another that says START FROM SELECTED ACTION end of it, without going to change the thing in settings
harump! cheers and skol!
 
  • Спасибо
Реакции: VladZen

Кто просматривает тему: (Всего: 1, Пользователи: 0, Гости: 1)