Link to home
Start Free TrialLog in
Avatar of Simon336697
Simon336697Flag for Australia

asked on

Reading a filename

Hi guys!

Hope you can help.

I want to, through perl, do the following....

Find a particular file.
The file is:         sdat*.zip

The path is: c:\sdat*.zip
where sdat could be sdat<any number or numbers>.zip
eg.sdat328.zip, sdat542.zip, any number at all.

I want to be able to:
a) Determine if sdat*.zip exists (if -e)
b) Read the filename (not read its contents), but the name of the file into a variable, minus the dot and file extension, and minus the sdat part, so only the number is to go into a variable.
c) Compare this number against another eg.5000
d) blah blah.

Basically, its just the first 2 parts i need help with.

Any help greatly appreciated.

S

ASKER CERTIFIED SOLUTION
Avatar of Tintin
Tintin

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Simon336697

ASKER

Thanks Tintin champion.

S