Checking number of delimiters

More
7 years 7 months ago #14590 by Jean
Hello

I have scenario where my flat file contains 13 fields.
My import has to fail if my flat file comes with != 13 fields in the file.

Please help me.
Thanks,
Jean

Please Log in or Create an account to join the conversation.

More
7 years 7 months ago #14591 by Peter.Jonson
Say for example your delimiter is comma.
So every line in the source file must have 12 commas.
Use Keep characters to delete all characters except commas,
Measure length of resulting string.
If it is not 12 abort processing.



Peter Jonson
ETL Developer
Attachments:

Please Log in or Create an account to join the conversation.

More
7 years 7 months ago #14592 by Jean
Replied by Jean on topic Checking number of delimiters
Thank you for detailed explanation.
I have never thought about fake delimiter :)

I am loading data into Oracle and I do not want to load any data from the files with problems.
If file is very big and the error is towards the end of the file I do not want to load data before the line with the problem :whistle:

Please Log in or Create an account to join the conversation.

More
7 years 7 months ago #14593 by admin
Replied by admin on topic Checking number of delimiters
Just put sorter object in the middle.
Than in case of validation error no data will be passed to the writer

Mike
ETL Architect

Please Log in or Create an account to join the conversation.