Groups | Search | Server Info | Login | Register
Groups > gnu.emacs.help > #60695
| From | Cecil Westerhof <Cecil@decebal.nl> |
|---|---|
| Newsgroups | gnu.emacs.help |
| Subject | Re: Sort from second field instead on second field |
| Date | 2023-03-29 19:55 +0200 |
| Organization | Decebal Computing |
| Message-ID | <87bkkbl9wm.fsf@munus.decebal.nl> (permalink) |
| References | <87sfdnlfkj.fsf@munus.decebal.nl> <87a5zva4vk.fsf@127.0.0.1> |
HASM <hasm@example.invalid> writes: >> You can sort lines in the region on the second field with: >> C-u 2 M-x sort-field >> In most cases this will probably be enough. But what if I would want >> to sort from the second field to the end of the line? > > Silly recipe: > > - mark at the first char of the first line of the region > > - go to last char of the last line of the region > > - M-x untabify > > - add enough spaces to the first line of the region to make it as long > as the longest line in the region > > - go to end of the first line, and mark > > - go to the beginning of the second field on the last line > > - M-x sort-columns > > Replace region with full buffer, if that's what you need > First and last line can be reversed above > Use C-u M-x sort-columns to reverse the sort order, as usual Works. Thanks. -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof
Back to gnu.emacs.help | Previous | Next — Previous in thread | Next in thread | Find similar
Sort from second field instead on second field Cecil Westerhof <Cecil@decebal.nl> - 2023-03-29 17:53 +0200
Re: Sort from second field instead on second field HASM <hasm@example.invalid> - 2023-03-29 09:39 -0700
Re: Sort from second field instead on second field Cecil Westerhof <Cecil@decebal.nl> - 2023-03-29 19:55 +0200
Re: Sort from second field instead on second field Ralf Fassel <ralfixx@gmx.de> - 2023-03-29 19:28 +0200
Re: Sort from second field instead on second field Cecil Westerhof <Cecil@decebal.nl> - 2023-03-30 07:03 +0200
csiph-web