Quantcast

Sorting

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Sorting

kassik
This post has NOT been accepted by the mailing list yet.

Hi
I am new in gnuplot. I have a file as follows:
1 11
2 12
3 13
4 14
5 15
and I want to sort it like :
5 15
4 14
3 13
2 12
1 11
I appreciate any help
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sorting

tmacchant
Use sort command but not gnuplot.

Tatsuro
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sorting

Stephen Wornom
Please the question in your response.
Thanks,

----- Original Message -----

> From: "tmacchant" <[hidden email]>
> To: [hidden email]
> Sent: Sunday, September 11, 2016 8:11:35 AM
> Subject: Re: [Gnuplot-info] Sorting
>
> Use sort command but not gnuplot.
>
> Tatsuro
>
>
>
> --
> View this message in context:
> http://gnuplot.10905.n7.nabble.com/Sorting-tp20351p20352.html
> Sent from the Gnuplot - User mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> _______________________________________________
> gnuplot-info mailing list
> [hidden email]
> Membership management via:
> https://lists.sourceforge.net/lists/listinfo/gnuplot-info
>

------------------------------------------------------------------------------
_______________________________________________
gnuplot-info mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sorting

tmacchant
In reply to this post by kassik
--- tmacchant  wrote:
> Use sort command but not gnuplot.
>
> Tatsuro

Search on web browser by keywords "gnuplot sort".  If you cannot get good solution, ask again with showing what you really want to do using gnuplot.

Tatsuro

------------------------------------------------------------------------------
_______________________________________________
gnuplot-info mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sorting

tmacchant
In reply to this post by kassik
The original question was made in the Nabble but has not been approved yet.

Here I write it.
*********************
Hi
I am new in gnuplot. I have a file as follows:
1 11
2 12
3 13
4 14
5 15
and I want to sort it like :
5 15
4 14
3 13
2 12
1 11
I appreciate any help  
****************

Tatsuro

--- Tatsuro MATSUOKA wrote:
> --- tmacchant  wrote:
> > Use sort command but not gnuplot.
> >
> > Tatsuro
>
> Search on web browser by keywords "gnuplot sort".  If you cannot get good solution, ask again with showing what you really want to do using gnuplot.
>
> Tatsuro
>

------------------------------------------------------------------------------
_______________________________________________
gnuplot-info mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sorting

Cédric ODY-2
Hello,

The following link

http://folk.uio.no/hpl/scripting/doc/gnuplot/Kawano/datafile3-e.html

shows how to use unix commands like sort within gnuplot.

For your example, you can also use the 'tac' command instead of 'sort'.
'tac' reverses the content of a file (cat <-> tac).

CO

Le 11/09/2016 à 23:32, Tatsuro MATSUOKA a écrit :

> The original question was made in the Nabble but has not been approved yet.
>
> Here I write it.
> *********************
> Hi
> I am new in gnuplot. I have a file as follows:
> 1 11
> 2 12
> 3 13
> 4 14
> 5 15
> and I want to sort it like :
> 5 15
> 4 14
> 3 13
> 2 12
> 1 11
> I appreciate any help
> ****************
>
> Tatsuro
>
> --- Tatsuro MATSUOKA wrote:
>> --- tmacchant  wrote:
>>> Use sort command but not gnuplot.
>>>
>>> Tatsuro
>> Search on web browser by keywords "gnuplot sort".  If you cannot get good solution, ask again with showing what you really want to do using gnuplot.
>>
>> Tatsuro
>>
> ------------------------------------------------------------------------------
> _______________________________________________
> gnuplot-info mailing list
> [hidden email]
> Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
>

--
--------------
02 98 49 86 04


------------------------------------------------------------------------------
_______________________________________________
gnuplot-info mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sorting

kassik
This post has NOT been accepted by the mailing list yet.
This post was updated on .
Thank y'all for your responses. Let me clear my question. Lets say I have this file:
   
-0.00512366  0.0156186  
-0.00510697  0.0154651  
-0.00509028  0.015312  
-0.00507359  0.0151593  
-0.0050569  0.0150072  
-0.00504021  0.0148556

And I want to move my last row to the top of my data file and so on. so I could have :

-0.00504021  0.0148556
-0.0050569  0.0150072
-0.00507359  0.0151593
-0.00509028  0.015312
-0.00510697  0.0154651
-0.00512366  0.0156186

I know that I could use "set xrange [* : *] reverse" command to do that when I am plotting it but I want to save the change in my data file.

Thank you
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sorting

tmacchant
This post has NOT been accepted by the mailing list yet.
This post was updated on Sep 13, 2016; 1:37am.
***********************************************************
Thank y'all for your responses. Let me clear my question. Lets say I have this file:
   
-0.00512366  0.0156186  
-0.00510697  0.0154651  
-0.00509028  0.015312  
-0.00507359  0.0151593  
-0.0050569  0.0150072  
-0.00504021  0.0148556

And I want to move my last row to the top of my data file and so on. so I could have :

-0.00504021  0.0148556
-0.0050569  0.0150072
-0.00507359  0.0151593
-0.00509028  0.015312
-0.00510697  0.0154651
-0.00512366  0.0156186

I know that I could use "set xrange [* : *] reverse" command to do that when I am plotting it but I want to save the change in my data file.

Thank you
*******************************************************************************

set xrange [* : *] reverse
set table 'data.txt'
plot (datafilename)
unset table

But this add 'i' to the third column.

See the output the below command or gnuplot manual [1]
gnuplot> help table

[1] http://gnuplot.sourceforge.net/docs_5.0/gnuplot.pdf

Tatsuro
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sorting

tmacchant
----- Original Message -----

> From: tmacchant
> To: gnuplot-info> Cc:
> Date: 2016/9/14, Wed 14:39
> Subject: Re: [Gnuplot-info] Sorting
>
> This post has NOT been accepted by the mailing list yet.
> This post was updated on Sep 13, 2016; 1:37am.
> ***********************************************************
> Thank y'all for your responses. Let me clear my question. Lets say I have
> this file:
>  
> -0.00512366  0.0156186 
> -0.00510697  0.0154651 
> -0.00509028  0.015312 
> -0.00507359  0.0151593 
> -0.0050569  0.0150072 
> -0.00504021  0.0148556
>
> And I want to move my last row to the top of my data file and so on. so I
> could have :
>
> -0.00504021  0.0148556
> -0.0050569  0.0150072
> -0.00507359  0.0151593
> -0.00509028  0.015312
> -0.00510697  0.0154651
> -0.00512366  0.0156186
>
> I know that I could use "set xrange [* : *] reverse" command to do
> that when
> I am plotting it but I want to save the change in my data file.
>
> Thank you
> *******************************************************************************
>
> set xrange [* : *] reverse
> set table 'data.txt'
> plot (datafilename)
> unset table
>
> But this add 'i' to the third column.
>
> See the output the below command or gnuplot manual [1]
> gnuplot> help table
>
> [1] http://gnuplot.sourceforge.net/docs_5.0/gnuplot.pdf
>
> Tatsuro

Sorry the above does not make sense.

Tatsuro


------------------------------------------------------------------------------
_______________________________________________
gnuplot-info mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sorting

tmacchant
----- Original Message -----

> From: Tatsuro MATSUOKA
> To: tmacchant3; gnuplot-info
> Cc:
> Date: 2016/9/14, Wed 16:17
> Subject: Re: [Gnuplot-info] Sorting
>
> ----- Original Message -----
>
>>  From: tmacchant
>>  To: gnuplot-info> Cc:
>>  Date: 2016/9/14, Wed 14:39
>>  Subject: Re: [Gnuplot-info] Sorting
>>
>>  This post has NOT been accepted by the mailing list yet.
>>  This post was updated on Sep 13, 2016; 1:37am.
>>  ***********************************************************
>>  Thank y'all for your responses. Let me clear my question. Lets say I
> have
>>  this file:
>>   
>>  -0.00512366  0.0156186 
>>  -0.00510697  0.0154651 
>>  -0.00509028  0.015312 
>>  -0.00507359  0.0151593 
>>  -0.0050569  0.0150072 
>>  -0.00504021  0.0148556
>>
>>  And I want to move my last row to the top of my data file and so on. so I
>>  could have :
>>
>>  -0.00504021  0.0148556
>>  -0.0050569  0.0150072
>>  -0.00507359  0.0151593
>>  -0.00509028  0.015312
>>  -0.00510697  0.0154651
>>  -0.00512366  0.0156186
>>
>>  I know that I could use "set xrange [* : *] reverse" command to
> do
>>  that when
>>  I am plotting it but I want to save the change in my data file.
>>
>>  Thank you
>>
> *******************************************************************************
>>
>>  set xrange [* : *] reverse
>>  set table 'data.txt'
>>  plot (datafilename)
>>  unset table
>>
>>  But this add 'i' to the third column.
>>
>>  See the output the below command or gnuplot manual [1]
>>  gnuplot> help table
>>
>>  [1] http://gnuplot.sourceforge.net/docs_5.0/gnuplot.pdf
>>
>>  Tatsuro
>
> Sorry the above does not make sense.
>
> Tatsuro

Keep in mind that gnuplot is a plotting software and
is not indented for data processing.

There is limitation of data processing facility of gnuplot.

In your case, as some people wrote, sort command is useful tool.

Tatsuro


------------------------------------------------------------------------------
_______________________________________________
gnuplot-info mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Sorting

Peter Schürch
Hi Tatsuro
Here are a range of options outside of gnuplot in a linux/unix/BSD shell that should work:
http://stackoverflow.com/questions/742466/how-can-i-reverse-the-order-of-lines-in-a-file

you can call a shell command from within gnuplot to do that if necessary. Read the manual for how to do that.

Peter

-----Ursprüngliche Nachricht-----
Von: Tatsuro MATSUOKA [mailto:[hidden email]]
Gesendet: Mittwoch, 14. September 2016 10:30
An: [hidden email]; [hidden email]
Betreff: Re: [Gnuplot-info] Sorting

----- Original Message -----

> From: Tatsuro MATSUOKA
> To: tmacchant3; gnuplot-info
> Cc:
> Date: 2016/9/14, Wed 16:17
> Subject: Re: [Gnuplot-info] Sorting
>
> ----- Original Message -----
>
>>  From: tmacchant
>>  To: gnuplot-info> Cc:
>>  Date: 2016/9/14, Wed 14:39
>>  Subject: Re: [Gnuplot-info] Sorting
>>
>>  This post has NOT been accepted by the mailing list yet.
>>  This post was updated on Sep 13, 2016; 1:37am.
>>  ***********************************************************
>>  Thank y'all for your responses. Let me clear my question. Lets say I
> have
>>  this file:
>>   
>>  -0.00512366  0.0156186
>>  -0.00510697  0.0154651
>>  -0.00509028  0.015312
>>  -0.00507359  0.0151593
>>  -0.0050569  0.0150072
>>  -0.00504021  0.0148556
>>
>>  And I want to move my last row to the top of my data file and so on.
>> so I  could have :
>>
>>  -0.00504021  0.0148556
>>  -0.0050569  0.0150072
>>  -0.00507359  0.0151593
>>  -0.00509028  0.015312
>>  -0.00510697  0.0154651
>>  -0.00512366  0.0156186
>>
>>  I know that I could use "set xrange [* : *] reverse" command to
> do
>>  that when
>>  I am plotting it but I want to save the change in my data file.
>>
>>  Thank you
>>
> **********************************************************************
> *********
>>
>>  set xrange [* : *] reverse
>>  set table 'data.txt'
>>  plot (datafilename)
>>  unset table
>>
>>  But this add 'i' to the third column.
>>
>>  See the output the below command or gnuplot manual [1]  gnuplot>
>> help table
>>
>>  [1] http://gnuplot.sourceforge.net/docs_5.0/gnuplot.pdf
>>
>>  Tatsuro
>
> Sorry the above does not make sense.
>
> Tatsuro

Keep in mind that gnuplot is a plotting software and is not indented for data processing.

There is limitation of data processing facility of gnuplot.

In your case, as some people wrote, sort command is useful tool.

Tatsuro


------------------------------------------------------------------------------
_______________________________________________
gnuplot-info mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info

------------------------------------------------------------------------------
_______________________________________________
gnuplot-info mailing list
[hidden email]
Membership management via: https://lists.sourceforge.net/lists/listinfo/gnuplot-info
Loading...