Re: How to sort by date in descending order

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

 



On Sun, Feb 28, 2010 at 4:20 AM, Roberto Ragusa <mail@xxxxxxxxxxxxxxxx> wrote:
> Dave Cross wrote:
>> On 26 February 2010 13:40, Roberto Ragusa <mail@xxxxxxxxxxxxxxxx> wrote:
>>> Richard Cahilig wrote:
>
>>>> Your help is very much appreciated. Thanks.
>>> while read a b; do s1=`date --date "$b" +%s`; echo $s1 $a $b;done <yourfile.txt | sort -nr
>>
>> Very nice. Just one small addition - pass the output through cut to
>> get back to the original data format:
>>
>> while read a b; do s1=`date --date "$b" +%s`; echo $s1 $a $b;done
>> <yourfile.txt | sort -nr | cut -f 2- -d ' '
>
> I left that as an exercise for the reader ;-)
>

this line works well too

sort -t- -k3n -k2 --sort=month  yourfile.txt


> --
>   Roberto Ragusa    mail at robertoragusa.it
> --
> users mailing list
> users@xxxxxxxxxxxxxxxxxxxxxxx
> To unsubscribe or change subscription options:
> https://admin.fedoraproject.org/mailman/listinfo/users
> Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
>



-- 
http://etvillage.blogspot.com/
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux