Operating System - OpenVMS
1826408 Members
4061 Online
109692 Solutions
New Discussion

Delete files named like *.*.*

 
SOLVED
Go to solution
Z.K.
Frequent Advisor

Delete files named like *.*.*

Hi all,
We got some files which have more than one dot in the filenames, like "*^.*.*". How can we delete this kind of files?
Our systerm-"OpenVMS v8.3"
4 REPLIES 4
John Gillings
Honored Contributor
Solution

Re: Delete files named like *.*.*

Z.K,

Dumb answer - with the DELETE command!

Seriously, you need to construct a filespec for DELETE which matches your files. With extra dots in the filename, you will need to escape those that aren't part of the RMS syntax using the circumflex character (as you have done in your question).

The tricky part will be working out which dot(s) are characters the NAME field of the filespec, which are characters in the TYPE field and which ONE is the delimiter between NAME and TYPE. Escape all the dots except the one which is syntactic.

You'll also need to set your PARSE_STYLE to EXTENDED (SET PROCESS/PARSE=EXTEND) to enable extended filename parsing.

For example:

$ SET PROCESS/CASE=SENSITIVE/PARSE=EXTENDED
$ DELETE MY^.file.Type^.with^.dots;*

In this case the syntactic dot is between the words "file" and "Type".

First few attempts, I'd recommend using DELETE/CONFIRM so you can check the filenames DELETE has matched before they get deleted.

Note that the wild card "*" will still match substrings that include dots and other special characters, so without setting parse style or case sensitivity, the file above could have been deleted with:

$ DELETE M*.T*;*
A crucible of informative mistakes
Z.K.
Frequent Advisor

Re: Delete files named like *.*.*

Thanks John!
Jan van den Ende
Honored Contributor

Re: Delete files named like *.*.*

Z.K.

If you need procedures that DELETE several/many of those files (as your * wildcrd suggests) you can write a little (eg DCL) program, which first does a scan for matching files (DCL: F$SEARCH(filespecs)
The answers you get from repetitive calls, ARE the correct syntax; now feed that into DELETE.

hth

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Z.K.
Frequent Advisor

Re: Delete files named like *.*.*

Jan,
Yes, that's a good idea. Thanks!