OnDemand User Group

Support Forums => Report Indexing => Topic started by: Michel de Kraker on December 30, 2014, 07:01:28 AM

Title: empty field in PDF form
Post by: Michel de Kraker on December 30, 2014, 07:01:28 AM
Hi all,

I have PDF forms which are archived to cmod. In these pdf's there are 2 fields: order date and amendment date.
Sometimes it happens that there is no date with amendment date, so empty. Is it possible in this case to index the order date as the amenddate also?

Thank you ,

kind regards,

Michel.
Title: Re: empty field in PDF form
Post by: frasert on January 01, 2015, 10:25:28 AM
Hi Michel,
You may be able to do this using a postprocessor script.  In the 'Load Information' tab of the application, put in the name of the script which will modify the .DB temporary file that gets created after indexing has completed.  I find awk works great for postprocessor scripts since the .DB file is a delimited columnar file.  An example script that may work for your needs would be:

script.awk:

Code: [Select]
BEGIN {
  FS="\t"
  OFS="\t"
}

NR > 1 {
  # assuming $2 is 'amendment date' and $1 is 'order date'
  if ($2 == "")
    $2 = $1
}

To see what the .DB temporary file looks like you can put in a fake postprocessor script name, like "abcd", and then run arsload against the file.  The load will fail during postprocessing and the .DB file should be out there.  You can test your awk script against the .DB file using:

awk -f script.awk nameofdbfile.DB
Title: Re: empty field in PDF form
Post by: Michel de Kraker on January 01, 2015, 10:28:07 AM
Hi Frasert,

thx for your input . will test this coming monday and will let you know.

Kind regards,

Michel.
Title: Re: empty field in PDF form
Post by: Michel de Kraker on January 06, 2015, 02:12:58 AM
Hi Frasert.

I tested your script , unfortunately i could not make it work.
Now i did the following. I made the amendmend date Field of type string instead of date.
In the indexexer information i made the default value Unamended.

This way the text Unamended is show when the amendmend date field is empty in the PDF form.

Thx for your suggestion and toughts,

Kind regards,
Michel.
Title: Re: empty field in PDF form
Post by: frasert on January 06, 2015, 08:06:20 AM
No problem Michel, glad you got a solution working.

-Tim
Title: Re: empty field in PDF form
Post by: ewirtz on January 07, 2015, 05:45:17 AM
Hi Michel,

your solution might be a problem for sorting and doing a between search. This can only be avoided if the date strings look like 'yyyymmdd'

regards

Egon