1753307 Members
6168 Online
108792 Solutions
New Discussion юеВ

Re: renaming files help

 
SOLVED
Go to solution
ben_moore34
Advisor

Re: renaming files help

Thanks for that

I'm getting somewhere with this now
The BENIN files are now showing as
BENIN.10
BENIN.11
BENIN.12
BENIN.14

That was using

$loop:
$ next = f$search("benin.*")
$ if next .eqs. "" then goto done
$ ext = f$parse(next,,,"type") - "."
$ if f$type(ext) .nes. "INTEGER" then goto done
$ if ext .lt. 300 then goto done
$ nwext = ext - 300
$ rename 'next' *.'nwext'
$ goto loop
$done:

Unfortunately for the program to process these files they need the .0 before the extention
ie
BENIN.010
BENIN.011

I think I'm going to have to do a bit of research into this tonight.


Robert Gezelter
Honored Contributor

Re: renaming files help

Ben,

Ok, with all due respect to Jan and Hein, this is why I try not to post code more than a line or so in length.

It is VERY dangerous to run code WITHOUT knowing precisely how it functions. It is easy to run something using CUT/PASTE that can cost dearly (I do presume that the directory was backed up BEFORE running this procedure).

The line:

nwext = ext - 300

Will subtract 300 from the number. The default for numeric->string conversion in DCL is the minimum number of digits.

In this instant case of all the numbers being between 300 and 399 inclusive, the problem can be corrected by changing the RENAME command:

$ rename 'next' *.'nwext

to

$ rename 'next' *.0'nwext

For a more general fix, one will need to look up the F$FAO lexical function and use the formatting options to reformat the name in whatever format is desired (e.g., hex, octal, decimal). One can also do other transformations as needed, if one wants to be more creative.

- Bob Gezelter, http://www.rlgsc.com
ben_moore34
Advisor

Re: renaming files help

Thankyou everyone for your help.
I really have learned a lot tonight
My problem has now been solved thanks to the help from all of you.

All files are now ready for processing (I did experiment on some test files that I created earlier)

I owe you all a pint.

When time allows I must learn some more DCL.
Incidenatally what kind of systems are you guys using?
We have a load of VAX 4000 machines

Bye for now
BM
Robert Gezelter
Honored Contributor

Re: renaming files help

Ben,

Glad to be of assistance!

VAX 4000 systems are one of the later generations of VAX systems.

In my lab, my systems range from MicroVAX II systems up through Alpha to Itanium.

Since DCL is the native scripting and command language, it is very useful. The best information is in the documentation set. Recent versions are available under "Documentation" at http://www.hp.com/go/openvms

While some details of DCL have been extended since the last VAX release, the language as a whole has been completely stable for a LONG time.

- Bob Gezelter, http://www.rlgsc.com
Jan van den Ende
Honored Contributor

Re: renaming files help

Ben,

>>>
I owe you all a pint.
<<<

Thank you very much. At the time you wrote that, I was having a Grimbergen Triple. For those who do not know: the Monastry of the Belgian village Grimbergen founded a brewery in 1128 (yes, nearly 900 years ago!)
The Triple is a high-fermenting yellow beer with a lot of body ("Stammwuerze") and 9% EtOH.

But on expressing your thanks in the Forum, please review

http://forums1.itrc.hp.com/service/forums/helptips.do?#33

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Jan van den Ende
Honored Contributor

Re: renaming files help

Ah, one more

>>>
Incidenatally what kind of systems are you guys using?
<<<

I have 2 Alpha 1000 systems at home. (plus 2 Vax 3100, but those have not seen any electricity since I moved in 2001, so they probably don't count)

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Hein van den Heuvel
Honored Contributor

Re: renaming files help

Ben>> owe you all a pint.
Jan> Thank you very much. At the time you wrote that, I was having a Grimbergen Triple

And I was enjoying a Shipyard seasonal (Prelude). I had a Grimbergen earlier this month.. in Eindhoven. Not my favourite, but I keep trying. Maybe some day.
For abbey beers I stick to the 'dubbel' (La Trappe). Martha's Exchange here in Nashua has a reasonable version of it on draft right now.

Ben>> Incidenatally what kind of systems are you guys using?

I 'tested' your request on my RX2620 Itanium.
In my lab I have a VaxStation 4000/60(?), 2xDS10, rx2620, rx2600, msa1000+14drives, 16/2 fibreswitch, 24xGigabit network, Decserver90m, BA356, DS2100, DL380, Linux ThinClient as 'terminal' for consoles/webbrowsing. Ebay!

Hein.


ben_moore34
Advisor

Re: renaming files help

Thanks.

I was having a bottle of Adnams Broadside (Suffolk Ale)when the file renames had completed.

I'm familiar with Grimbergen beers, they can be found from time to time in shops & bars here (have only tried the one with the yellow label). I really like those Abbey beers. I want to try them all.

Cheers Guys