Operating System - OpenVMS
1752619 Members
4434 Online
108788 Solutions
New Discussion юеВ

How to sort all files by date in ascending order

 
P Muralidhar Kini
Honored Contributor

Re: How to sort all files by date in ascending order

Hi Joseph,

>> Directory the wraps the rest of the output to a second line,
>> and sort will be confused.
Thats a good point.
The parsing routine has to consider this scenario that a filename can get
displayed in multiple lines and needs to be able to handle that.

Also another thing to consider (may not be in this case),
When parsing a line of DIR output, program cannot check directly for any
known characters like "(" and so on. i.e. it cannot rely on the fact that
the "(" ... is a delimiter. These characters can be a part of the filename
(ODS5 filenames allows that). The program needs to be take care of this.

Regards,
Murali
Let There Be Rock - AC/DC
John McL
Trusted Contributor

Re: How to sort all files by date in ascending order

One day maybe HP will add a /SORT=x capability to $ DIRECTORY and let us sort by filesize, by any date and by (what else?), of course with the default being by filename ... but it's not available yet.
P Muralidhar Kini
Honored Contributor

Re: How to sort all files by date in ascending order

John,Jess

>> One day maybe HP will add a /SORT=x capability to $ DIRECTORY
Let me know if there is any business requirement for availability of this feature.
I can add this to the wish list along with the supporting text.

Regards,
Murali
Let There Be Rock - AC/DC
Kris Clippeleyr
Honored Contributor

Re: How to sort all files by date in ascending order


> One day maybe HP will add a /SORT=x
> capability to $ DIRECTORY and let us sort
> by filesize, by any date and by (what
> else?), of course with the default being
> by filename ... but it's not available
> yet.

It's already there. Check out QDSB (as Joseph already pointed out) at
http://www.quadratrix.be/qdsb.html

Regards,
Kris (aka Qkcl)
I'm gonna hit the highway like a battering ram on a silver-black phantom bike...
P Muralidhar Kini
Honored Contributor

Re: How to sort all files by date in ascending order

Hi Kris,

>> It's already there. Check out QDSB (as Joseph already pointed out) at
>> http://www.quadratrix.be/qdsb.html
Yes, thats right. I missed seeing this before.

I did a quick instal and checked it out.
It provides the feature which sorts and displays entries in the directory based
on name, creation date, type and so on.
Nice tool.

Jess,
The QDSB tool gives you the feature that you are looking for.
In case you have not already started using it, you can start now.

Regards,
Murali
Let There Be Rock - AC/DC
Shriniketan Bhagwat
Trusted Contributor

Re: How to sort all files by date in ascending order

Hi Kris,

Even I have also tried this tool.
This is really a nice tool. Thanks for letting us to know about such a good tool.

Regards,
Ketan
Joseph Huber_1
Honored Contributor

Re: How to sort all files by date in ascending order

And since I work on a linux desktop, I got used to use the "ls" command on VMS as well.
My above reply to use GNV ls -lt, ls -ltr means:
either define
bash :== $GNU:[bin]bash (GNV$GNU:[BIN] for newer versions of GNV)
or have GNU:[bin] in Your DCL$path logical list.

Then define the DCL ls command as
ls == "bash -c ""ls"
(sic ! the missing double quote at the end is intended).
Through the "bash -c" call ls works with (unix-style) wildcards, while a direct "ls := $GNU:[bin]ls" will not work with wildcards.

In a similar fashion other bash shell commands can be defined:
$ rm == "bash -c ""rm"
$ cat == "bash -c ""cat"
$ gdiff == "bash -c ""diff"
$ grep == "bash -c ""grep"
$ egrep == "bash -c ""egrep"
$ fgrep == "bash -c ""fgrep"
$ touch == "bash -c ""touch"

"cd" cannot be used like this, because it is a bash internal command.


http://www.mpp.mpg.de/~huber
Keith Cayemberg
Trusted Contributor

Re: How to sort all files by date in ascending order


Sorting DIRECTORY by modification date

[posted to comp.os.vms by Peter Weaver (WeaverConsultingServices@sympatico.ca) on 29-APR-2004]

$ ASSIGN LIB$DATE_FORMAT_037,-
LIB$TIME_FORMAT_001 -
LIB$DT_FORMAT/USER_MODE
$! Ignore any DIR symbols
$ directx -
/date=modified-
/width=(file:80,display:132)-
/out=out.txt
$ sort out.txt -
/key=(pos:83,siz:22) tt:

should do it as long as someone with privileges did the @SYS$STARTUP:LIB$DT_STARTUP first.
Keith Cayemberg
Consultant
Wipro Technologies
Hoff
Honored Contributor

Re: How to sort all files by date in ascending order

Install and configure GNV.

$ bash
ls -tla
P Muralidhar Kini
Honored Contributor

Re: How to sort all files by date in ascending order

Hi Jess,

I hope you are using (might have become expert :)) the QDSB tool by now.

Also, Refer the following link which says how you can thank the forum -
http://forums11.itrc.hp.com/service/forums/helptips.do?#28

Regards,
Murali
Let There Be Rock - AC/DC