You are not logged in.
Pages: 1
hi all
i have a text file that contains archlinux package information int he following formate:
File:alpine-2.00-1-i686.pkg.tar.gz 3623 KB 09/05/2008 10:53:00 PM
File:alsa-lib-1.0.18-1-i686.pkg.tar.gz 474 KB 11/08/2008 04:46:00 PM
File:alsa-oss-1.0.17-1-i686.pkg.tar.gz 50 KB 09/28/2008 04:25:00 PM
File:alsa-utils-1.0.18-1-i686.pkg.tar.gz 1047 KB 11/08/2008 04:46:00 PM
...
what is the easiest way to sort the order according to different criteria such as file size, creation time, name etc
i'm thinking of using a database software such as sqlite.
if this is the correct direction to go, can anyone show me some hints on how i should go about to accomplish this task ?
thanks in advance
Offline
after some digging
it seems awk can do the trick
i found some code snippets
i'll try it later
but i'm still curious about doing this using sqlite and the SQL language
like can i create a database from a formated text file? etc
so anyone has some comments on this, you are still welcome
Last edited by elflord (2008-11-15 17:56:18)
Offline
just use sort:
sort by first field: sort -k 1,1 <file>
surt by first & second, second numeric: sort -k 1,2n <file>
Stand back, intruder, or i'll blast you out of space! I am Klixon and I don't want any dealings with you human lifeforms. I'm a cyborg!
Offline
Pages: 1