EXtract Data from PDF and write to excel

Hello all,

i’m working on an activity to extract data from a PDF and insert it in an excel file.

I’m in the first step… i’m trying to read data with regex from a PDF and now i’m trying to write result in a log message…

for that i’m using :slight_smile:

  1. “READ PDF Text” with pdf file name
  2. “Matches” and cofnigured regular expression
    /(?<=TEXTEXAMPLE:\s)(.*?(?=\s))/g+
    an put the result in “OutputResult” variable
  3. Write Line with:
    (OutputResult.Value).ToString

But I get “Write Line: Object reference not set to an instance of an object”…

I don’t understand what is the issue…

Coud you help me please?

HI @Luca09

If you used Matches you need to use like

Expression(0) to get the first match

If you used match you use .Value or .ToString

Regards
Sudharsan

@Luca09

As per the error either your matches activity is not giving any output or is not matching any data …

The error says that the variable you are trying to use is null or is not initialized…

Please check the same

Cheers

Thanks @Anil_G

there was an error in the REGEX expression… fixed and not i get the result :slight_smile:
thanks!

1 Like

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