all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* M-x Sort-Columns in scientific format
@ 2007-08-14 18:07 gokhalen
  2007-08-14 19:28 ` weber
  0 siblings, 1 reply; 9+ messages in thread
From: gokhalen @ 2007-08-14 18:07 UTC (permalink / raw)
  To: help-gnu-emacs

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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: M-x Sort-Columns in scientific format
  2007-08-14 18:07 M-x Sort-Columns in scientific format gokhalen
@ 2007-08-14 19:28 ` weber
  2007-08-14 20:05   ` gokhalen
  0 siblings, 1 reply; 9+ messages in thread
From: weber @ 2007-08-14 19:28 UTC (permalink / raw)
  To: help-gnu-emacs

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: M-x Sort-Columns in scientific format
  2007-08-14 19:28 ` weber
@ 2007-08-14 20:05   ` gokhalen
  2007-08-14 20:44     ` weber
  2007-08-14 22:58     ` Mark Elston
  0 siblings, 2 replies; 9+ messages in thread
From: gokhalen @ 2007-08-14 20:05 UTC (permalink / raw)
  To: help-gnu-emacs

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.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: M-x Sort-Columns in scientific format
  2007-08-14 20:05   ` gokhalen
@ 2007-08-14 20:44     ` weber
  2007-08-14 22:58     ` Mark Elston
  1 sibling, 0 replies; 9+ messages in thread
From: weber @ 2007-08-14 20:44 UTC (permalink / raw)
  To: help-gnu-emacs

On 14 ago, 17:05, gokha...@gmail.com wrote:
> 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.

Here i get:

CC   7.0E-5
BB   8.0E-5
AA   1.0E-4

Which looks correct...

-weber

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: M-x Sort-Columns in scientific format
  2007-08-14 20:05   ` gokhalen
  2007-08-14 20:44     ` weber
@ 2007-08-14 22:58     ` Mark Elston
  2007-08-15 13:36       ` gokhalen
  1 sibling, 1 reply; 9+ messages in thread
From: Mark Elston @ 2007-08-14 22:58 UTC (permalink / raw)
  To: help-gnu-emacs

* gokhalen@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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: M-x Sort-Columns in scientific format
  2007-08-14 22:58     ` Mark Elston
@ 2007-08-15 13:36       ` gokhalen
  2007-08-15 14:37         ` weber
  0 siblings, 1 reply; 9+ messages in thread
From: gokhalen @ 2007-08-15 13:36 UTC (permalink / raw)
  To: help-gnu-emacs

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: M-x Sort-Columns in scientific format
  2007-08-15 13:36       ` gokhalen
@ 2007-08-15 14:37         ` weber
  2007-08-15 22:21           ` Kenneth Jacker
  0 siblings, 1 reply; 9+ messages in thread
From: weber @ 2007-08-15 14:37 UTC (permalink / raw)
  To: help-gnu-emacs

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: M-x Sort-Columns in scientific format
  2007-08-15 14:37         ` weber
@ 2007-08-15 22:21           ` Kenneth Jacker
  2007-08-15 23:40             ` Pascal Bourguignon
  0 siblings, 1 reply; 9+ messages in thread
From: Kenneth Jacker @ 2007-08-15 22:21 UTC (permalink / raw)
  To: help-gnu-emacs

  hugows> You can give an argument to most editing commands; try for example:
  hugows>
  hugows> C-u 80 C-u =

I don't think you need that second "C-u".  This works fine for me:

          C-u 80 =

-- 
Prof Kenneth H Jacker       khj@cs.appstate.edu
Computer Science Dept       www.cs.appstate.edu/~khj
Appalachian State Univ
Boone, NC  28608  USA        

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: M-x Sort-Columns in scientific format
  2007-08-15 22:21           ` Kenneth Jacker
@ 2007-08-15 23:40             ` Pascal Bourguignon
  0 siblings, 0 replies; 9+ messages in thread
From: Pascal Bourguignon @ 2007-08-15 23:40 UTC (permalink / raw)
  To: help-gnu-emacs

Kenneth Jacker <khj@be.cs.appstate.edu> writes:

>   hugows> You can give an argument to most editing commands; try for example:
>   hugows>
>   hugows> C-u 80 C-u =
>
> I don't think you need that second "C-u".  This works fine for me:
>
>           C-u 80 =

C-u nn C-u is the general case when you want to insert digits:

C-u 5 C-u 3       --> 33333

In X: C-5 C-u 3   --> 33333


-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

NOTE: The most fundamental particles in this product are held
together by a "gluing" force about which little is currently known
and whose adhesive power can therefore not be permanently
guaranteed.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2007-08-15 23:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-14 18:07 M-x Sort-Columns in scientific format gokhalen
2007-08-14 19:28 ` weber
2007-08-14 20:05   ` gokhalen
2007-08-14 20:44     ` weber
2007-08-14 22:58     ` Mark Elston
2007-08-15 13:36       ` gokhalen
2007-08-15 14:37         ` weber
2007-08-15 22:21           ` Kenneth Jacker
2007-08-15 23:40             ` Pascal Bourguignon

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.