How to save and write data on Excel

there are multiple files i wanna extract some data from pdf files with regex , so first i used this following activity
for each files in folder -->[ read pdf text → write text file → matches used 3 times → build data {DT} → assign → multiple assign → invoke Code → build data table {pdfDT} → merge data table ] -->write excel file

bot is run properly and bot gives first pdf data , when run loop again for second pdf file , the the first pdf data remove from the datatable and and write the second pdf file and , when i run the loop for third files the remove the second pdf data from datatable , and writes the thrid pdf data on datatable
i wanna write all 30 pdf data on pdfDT datatable and write on excel files
Thanks,

@UJJVAL_BHAGAT,

Your Final Datatable or Dt to store all file data should be declared before For each PDF file.
Inside the loop, use Merge DataTable to merge if you have multiple rows else, just use Add Data Row to add a row to your final DT.

Still not clear, share your workflow. I will take a look and suggest a solution.

Thanks,
Ashok :slight_smile:

@UJJVAL_BHAGAT

I believe build datatable is to build the mergeddt…if so you have to use it before the for loop

If you build for eqch loop then data gets over written

Cheers