I need to sort a text file, longest line length to shortest, and alphabetical with the list for each length that is the same length. Any ideas?
Thanks
Sort based on length of line and alphabetical each length
Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard
-
ben_josephs
- Posts: 2464
- Joined: Sun Mar 02, 2003 9:22 pm
There's no way in TextPad of sorting lines by length that I know of. You can use regular expressions to find lines of a given length (or shorter than or greater than a given length) but it would be very tedious to use them for sorting.
^.{42}$ matches lines exactly 42 characters long.
^.{42,}$ matches lines at least 42 characters long.
^.{0,41}$ matches lines at most 42 characters long.
These assume you are using Posix regular expression syntax:
^.{42}$ matches lines exactly 42 characters long.
^.{42,}$ matches lines at least 42 characters long.
^.{0,41}$ matches lines at most 42 characters long.
These assume you are using Posix regular expression syntax:
You can use Tools | Sort... to sort the lines in each group of lines of the same length. This, again, could be very tedious.Configure | Preferences | Editor
[X] Use POSIX regular expression syntax