Flat File Parsing

Guys,
I need to parse csv files. I am using

pub.file.getFile  
   To convert file to Object 
pub.flatFile.convertToValues 
   To parse the files 

Some times if the files is not in accordance with the Flat File struture/Schema, the flow Service is just processing. I mean it should ideally it should exit the service with some kind of error message. 

Can some one help me out.

Thanks,
Brain.

Hi Brain,

Do you have sequence steps(try/catch blocks).If yes, have you set “Exit on Failure” for ‘try’ Sequence step.

HTH.

Pauly

Brain,

As Pauly said use the Try/Catch Sequences,here is the snippet,

Sequence(Exit on SUCCESS)
—>Sequence(Exit on FAILURE)–Try
-------pub.file.getFile
-------pub.flatFile.convertToValues
------->Mapping steps…
---->Sequence(Exit on DONE)–Catch
------>pub.flow:getLastError(this output holds all the error dump)
------->Nofify the Errors(using pub.client:smtp)
------->Exit the flow (Failure)

So any kind of Invalid Schema,null pointer exceptions the errors will be caught in the DONE sequence.

HTH,
RMG.

Guys,
I am using the above given steps. But some times, it goes into a loop in step 3 (-------pub.flatFile.convertToValues).

Its hanging up in the above step and is never coming to Mapping Steps.

Thanks,
Brain.

Brain,

If you are setting iterate=true in the pub.flatFile.convertToValues, and then check on the ffIterator value is “null” in the pipeline, then you have to Exit the loop and move the process further.

HTH
RMG.

Hi RMG,

what do i have to input to the loop!
Before the pub.flatFile.convertToValues i only have the getFile(as Stream)!!!??

pls can you help?
thx Werner