次の例では、並べ替える必要がある 3 つの要素があります。
- 「[aaa]」とその下の 4 行 (常に 4 行) が 1 つのユニットを形成します。
- 「[kkk]」とその下の 4 行 (常に 4 行) が 1 つのユニットを形成します。
- "[zzz]" とその下の 4 行 (常に 4 行) が 1 つのユニットを形成します。
このパターンに従う行のグループのみをソートする必要があります。「[aaa]」の前と「[zzz]」の 4 行目以降はそのままにしておく必要があります。
から:
This sentence and everything above it should not be sorted.
[zzz]
some
random
text
here
[aaa]
bla
blo
blu
bli
[kkk]
1
44
2
88
And neither should this one and everything below it.
に:
This sentence and everything above it should not be sorted.
[aaa]
bla
blo
blu
bli
[kkk]
1
44
2
88
[zzz]
some
random
text
here
And neither should this one and everything below it.