Rather than killing yourself trying to get this done in Emacs, try creating
a shell script that does the job.
You can use <esc>| after selecting the region of your buffer to execute the
shell script on.

-- Bill Morita
512-569-6387 (Cell)


On Tue, Oct 27, 2020 at 9:21 AM Rich Shepard <[email protected]>
wrote:

> I have a file of data to import into a database table. Each row is enclosed
> in parentheses and the first field/column is numeric; the table's PK.
>
> To check there are no duplicate rows I want to sort the numerically but
> both
> emac's M-x sort-numeric-fields and M-x sort-fields fail the task.
>
> The former should work but I see results such as:
> (2241,3,...
> (440,1,...
> (441,1,...
> (441,2,...
> (441,3,...
> (441,4,...
> (441,5,,,,
> (555,1,...
> (504,1,...
> (408,1,...
> (408,2,...
> (2243,1,...
> and similar series of out-of-sequence rows.
>
> M-x sort-fields sorts digit-by-digit rather than group-by-group.
>
> Do I need to temprarily remove the opening parenthesis at the beginning of
> the line for emacs to recognize the first field as numeric?
>
> Rich
> _______________________________________________
> PLUG: https://pdxlinux.org
> PLUG mailing list
> [email protected]
> http://lists.pdxlinux.org/mailman/listinfo/plug
>
_______________________________________________
PLUG: https://pdxlinux.org
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to