How to read the Amount value through each File name?

I have some files in this folder from each file i have to read the amount value and copy it into excel ?

Thanks in advance

Hi…@rsr.chandu - To be specific you want the amount after EUR right?

Yes Eur followed by Amount EUR 32.832,54

@rsr.chandu - Thanks…One more question sorry…so you want to capture the EUR also right? or without EUR as shown below is fine?

I need without EUR

@rsr.chandu - Good…

  1. Read the files in the folder using ArrFiles=Directory.getfiles(YourFilepath,“*.pdf”). Here ArrFiles is stringArray
  2. In the For Each loop, EachFile of ArrFiles
    StrAmount=Regex.Matches(Path.getfilenamewithextension(Eachfile),“(?<=EUR\s).*”)(0).tostring

Please find the starter help here…


image

1 Like

I am getting this kind of error?

@rsr.chandu …In your For Each…you used Item…so instead of EachFile, you have to use Item…please note that your for each type should be string…

I Updated still i got the same

@rsr.chandu - Regex_rsr.zip (176.1 KB)

Please import: System.text.RegularExpressions…

image

Hope this helps…

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.