Forum Discussion

Soumic_Mohanty's avatar
Soumic_Mohanty
New Contributor II
2 years ago

Error out the entire csv file if one of the value in a row/rows is/are missing.

Hi All,
I am reading an csv file & would send the entire file to error if any of the value in a row/rows are empty.
Using Data validator snap i tried to find out the error row or rows.
How ever unable to send the entire file to error.
Can someone help me with the scenario. 

 

5 Replies

  • Soumic_Mohanty - one simple solution is to use the error view on the Data Validator, then a Gate to collect the count of errors, followed by a Router to check if there were errors.  Finally, re-read the file to begin processing only if there were no issues.

    Note that you will want to set your Gate snap "Output Document Count" to either "Document count and first..." or "Document count and last..." option; otherwise, it will consume all input data into memory which could be very resource intensive and not recommended.

    The Router then just needs to check the output from your Gate snap to determine if the error path fed into it had any records.

    Hope this helps!

    • Soumic_Mohanty's avatar
      Soumic_Mohanty
      New Contributor II

      Hi Kory,
      Thank you for your help.
      I tried to use the same configuration, however still I am stuck.
      Would you please share the SLP file here.

  • Soumic_Mohanty's avatar
    Soumic_Mohanty
    New Contributor II

    I tried to use the same configuration, however still I am stuck.
    Would you please share the SLP file here.