Save file with particular ID


i have a mail attachment with pdf file and the name for this file will differs as below where ID will present in every file name.Now i want to save the file with only ID into local folder.

File name examples below:

  1. CDDoc_0852425804.pdf
  2. HTDoc_9342573857.pdf
  3. VTDoc_8347293240.pdf

i want save the attahcment with only ID ,can anyone heklp me on this.


with a regex match you can extract the ID from filename and later use for file name
have a look here

1 Like