Hello, @znc-gatilho, @alan-kilborn, @peterjones, @mark-olson, @coises and All,
@znc-gatilho, could you confirm me that your three important zones are, by priority order :
Zone 'SRtng' : Between columns 114 and 118 ( 5 chars )
Zone 'Tit' : Between columns 77 and 79 ( 3 chars )
Zone 'WTit' : Between columns 82 and 85 ( 4 chars )
If so, let’s start with this INPUT text, containing the headers line 1 and 3 random records ( lines 626897, 626912 and 626917 )
ID Number Name Fed Sex Tit WTit OTit FOA SRtng SGm SK RRtng RGm Rk BRtng BGM BK B-day Flag
4109228 Kryukova, Irina RUS F WGN WNM 2232 0 20 2240 0 20 1968 wi
36016672 Kryvinski, Jenny FRA F 2001 w
14102897 Kryvolapov, Kostiantyn UJR M IM 2356 1 10 2327 0 20 1962
Open these four lines text in a new tab
Move to the very beginning of your file ( Ctrl + Home )
Open the Replace dialog ( Ctrl + H )
Un-tick all box options
Type in (?-s)^.{76}(...)..(....).{28}(.....).+ in the Find what : zone
Type in \3 \1 \2 $0 in the Replace with : zone
Select the Regular expression search mode
Click on the Replace All button
=> At once, you should get this temporary text :
SRtng Tit WTit ID Number Name Fed Sex Tit WTit OTit FOA SRtng SGm SK RRtng RGm Rk BRtng BGM BK B-day Flag
2232 WGN WNM 4109228 Kryukova, Irina RUS F WGN WNM 2232 0 20 2240 0 20 1968 wi
36016672 Kryvinski, Jenny FRA F 2001 w
2356 IM 14102897 Kryvolapov, Kostiantyn UJR M IM 2356 1 10 2327 0 20 1962
Now, select the three lines, after the headers line
Run the Edit > Line Operations > Sort Lines Lexicographically Ascending option
=> You should get your expected OUTPUT text :
SRtng Tit WTit ID Number Name Fed Sex Tit WTit OTit FOA SRtng SGm SK RRtng RGm Rk BRtng BGM BK B-day Flag
36016672 Kryvinski, Jenny FRA F 2001 w
2232 WGN WNM 4109228 Kryukova, Irina RUS F WGN WNM 2232 0 20 2240 0 20 1968 wi
2356 IM 14102897 Kryvolapov, Kostiantyn UJR M IM 2356 1 10 2327 0 20 1962
As you can see your file is, automatically sorted by the three zones SRtng then by Tit then by WTit ascending
BTW, @Peterjones, I suppose that the SRtng zone is the ELO rating of chess players, which is ALWAYS a 4 number string for experienced players and grand masters ! . So, no trouble for the sort
Now, just repeat the steps above, with your players_list_FOA.txt file
Of course, do a backup of your players_list_FOA.txt, before any action
Beware that your file is really an huge file ( 216,785,860 bytes for 1,321,866 lines !! )
Thus, I cannot tell you how longer the search/replacement and the save operations will take till completion, when applied to THIS file !
However, you can give it a try !
Of course, in case that the zones do not belong to the mentioned ranges, just tell me the exact values in order to modify the search regex, accordingly :-)
Best Regards,
guy038