There are around 30 pdf files I want fetch the amount from the each file, if the pdf is not contain any amount then i need to ignore that pdf file, if the pdf contains amount then i need to take the amount and write into the excel file.
Can anyone please help me to solve the above automation.
A simpler approach is to read PDF files using https://docs.uipath.com/activities/docs/read-pdf-text and check if required text is present or not using string.contains
If amount is a number, you can make use of Regex for searching amount.
Hi @HeartCatcher
The general structure you can solve ur issue is
Use assign actity to get the list of all pdf files in that folder using assign activity
files_list=Directory.GetFiles(folder,“*.pdf”)
use Build datatable with required columns where u need to add amount data and store dt1 datatable variable.
now use for each to loop through each file (for file in file_list ) with type argument as String
inside it use the below activities
a. Use Read PDF activity to read the pdf and store in string input_text
b. U can use isMatch or contains method to validate whether the amount is present there or not
c. if the above expression is true, then extract the amount data by using Regex or string manipulation and store in datatable using add datatrow activity to add amount data in dt1.
d. if the expression id false, then use continue action to skip the current iteration and move to next one.
Hope it helps
Mark it as solution if it solves ur query
Regards,
Nived N
For each session there will be 2 files Presentation(presented column) File Return(received) Settlement File.
File name with _R is a return settlement file and file without R is the presentation file.
ACHCR is credit Settlement file and ACHDR is debit settlement file."