Page 1 of 1

File Pattern

Posted: Tue Jun 15, 2010 4:40 pm
by kogads
Hi All,
We have a requirement to capture all the files in a folder which have same metadata. I am using the file pattern to read all the files using sequential file stage. How can we track the file that is causing problem or the file that cant be extracted from the set of files.

Thanks in advanse.

Posted: Tue Jun 15, 2010 10:57 pm
by keshav0307
check this post and try setting those parameters,.
viewtopic.php?t=121263

Posted: Wed Jun 16, 2010 10:36 am
by kogads
I still cant understand how we can track the error file if we have the environment variable $APT_IMPORT_PATTERN_USES_FILESET set to true and File Name column is provides in sequential file?

Posted: Wed Jun 16, 2010 12:03 pm
by anbu
You can run an awk command to find list of files which dont match metadata

Code: Select all

for file in *
do
  awk -F"," -v no_of_fields=2 ' NF != no_of_fields { print FILENAME;  exit } ' $file
done
Replace comma by field delimiter and assign no_of_fields as per your input

Posted: Wed Jun 16, 2010 2:12 pm
by chulett
kogads wrote:I still cant understand how we can track the error file if we have the environment variable $APT_IMPORT_PATTERN_USES_FILESET set to true and File Name column is provides in sequential file?
It lets you know which one of the (possibly many) files you are reading that any particular record is from.