help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: M-x Sort-Columns in scientific format


From: weber
Subject: Re: M-x Sort-Columns in scientific format
Date: Wed, 15 Aug 2007 14:37:00 -0000
User-agent: G2/1.0

On 15 ago, 10:36, gokha...@gmail.com wrote:
> On Aug 14, 6:58 pm, Mark Elston <m.els...@advantest-ard.com> wrote:
>
>
>
> > * gokha...@gmail.com wrote (on 8/14/2007 1:05 PM):
>
> > > On Aug 14, 3:28 pm, weber <hug...@gmail.com> wrote:
> > >> On 14 ago, 15:07, gokha...@gmail.com wrote:
>
> > >>> If I have a file with two fields:
> > >>> BB     2
> > >>> AA     1
> > >>> CC    3
> > >>> And I do Mx sort-columns on the last column I get
> > >>> AA     1
> > >>> BB     2
> > >>> CC    3
> > >>> Which is good.  Now, if I change the numbers to scientific format:
> > >>> BB   8.0E-5
> > >>> AA   1.0E-4
> > >>> CC   7.0E-5
> > >>> I get the following, with Mx sort-columns
> > >>> AA   1.0E-4
> > >>> CC   7.0E-5
> > >>> BB   8.0E-5
> > >>> Which is not what should happen. Emacs is ignoring the exponent. Is
> > >>> there a way to turn scientific number more on? How do I get Mx Sort-
> > >>> Columns in scientific format?
> > >>> I am using the windows version of emacs.
> > >>> Thanks.
> > >> sort-numeric-fields command works here!
> > >> Cheers,
> > >> weber
>
> > > Well,
>
> > > sort-numeric-fields on the last column gives me
>
> > > BB  AA   1.0E-4
> > > CC   7.0E-5
> > >  8.0E-5
>
> > > Which is garbled.
>
> > Try selecting the whole region and then C-u 2 M-x sort-numeric-fields
>
> > Mark
>
> Thanks, that worked. What is this C-u 2 magic?
>
> -Nachiket

This is how sort-numeric-fields and many other commands work: with an
prefix argument. This tells sort-numeric-fields that you want to sort
by the 2nd column. You can read more here:
http://www.gnu.org/software/emacs/manual/html_node/elisp/Prefix-Command-Arguments.html

You can give an argument to most editing commands; try for example:

C-u 80 C-u =

to insert a line of "========" etc.

Cheers,
weber



reply via email to

[Prev in Thread] Current Thread [Next in Thread]