variable from part of filename

hi! there is a filename file111.pdf
every time filename is changing - it maybe file222.pdf , file321.pdf
every time i must create this file’s zip archive , which name must consist part of file , which every time changing - 111,321,222 … at last my archive must be named like - file111.zip

how i can do this?

Hi,

I’ve just posted an universal routine to create a zip archive in Code Exchange

i still dont understand (((
it s too difficult…

What do you want exactly to accomplish?

i have on my mac in one folder such files

journal_138_07_004.pdf
journal_138_08_004.pdf
journal_138_09_004.pdf
etc…

138 is number , which change every day , tomorrow it will be 139

script must create an archive with “138” (this number script must take from filename) , mask of its name must be journal_138_tomorrow’s date and time.pdf

such script

Sorry, I don’t understand either.

Do you have a source file journal_138_07_004.pdf and an archive from this file with name 138.zip should be created?
Do you have a source file journal_138_07_004.pdf and an archive from this file with name journal_138_2007_07_30.zip should be created?
Or do you want to create one archive for all pdf files of one day?

I have a source files in one folder - all of them named journal_138_07_004.pdf , journal_138_08_004.pdf and an archive from this file with name journal_138_2007_07_30.zip should be created! what can u advice me?

This is the 209th day of the year. It is also the 30th week of the year, so in terms of business days, Friday was day 150. How is 138 computed? How would a script “know” what that number was?

this file or these files?
Sorry, progamming needs a unique condition to do something.
Do you want a .zip including all files with 138 in the file name (I assume this) or one .zip per file?
And which relation has the number (138) to the current date?

Questions, questions. :wink:

to stefan k:
my answers…
i mean these files (dont matter with 138 or not) ,all files in selected folder
number 138 is generating by other software- and this number have NOT any relations with date
sorry for my pretty english - this is not my native language…