How read text date on PDF document for new rename files

Hi there i am newbie
Can your help or guide me to Read files pdf in folder and use text date on document for new rename files, Thank you.


File Name : T0001111222.pdf

Text date on document : 2022-01-01

I need format new rename file to : 20220101-T0001111222.pdf


Try below steps.

  1. First use below expression to read all pdf files from particular folder.
    arrPdfFiles = Directory.GetFiles(“FolderPath”,“*.pdf”)

  2. And then use For Each loop activity to iterate one by one pdf file.

           For Each item in arrPdfFiles
               Use Read PDF Text activity and pass item to it and it will give output as String. Lets say **strPdfText**.
               strDate = strPdfText.SubString(strPdfText.IndexOf("Date: ")+"Date: ".Length).Split(Environment.NewLine.ToCharArray)(0).Trim.Replace("-","")
               use Move File activity and pass From and To Path as below.
                    From Path: item
                    To Path: "FolderPath"+"\"+strDate+"-"+Path.GetFileName(item)