Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Save $650 on Qlik Connect, Dec 1 - 7, our lowest price of the year. Register with code CYBERWEEK: Register
cancel
Showing results for 
Search instead for 
Did you mean: 
RA6
Creator
Creator

File check - check columns + delimiters

Hello all,

 

Everyday i process a csv file (0683p000009MA9p.png with 15 columns but sometimes the format of this file is not correct which may be an error with an extraction itself.

 

Types of errors with the csv file :

 

- Number of column greater than 15

- Number of column less than 15

- Number of column is 15 but certain row contain only > OR < column

 

How can i check each of these errors before processing? If one of these are found, i can use tDie to end the process.

 

In my case, i cannot use tSchemaComplianceCheck, since it verifies only type, length, null, date format?

 

Good file :

  

Nom;Prenom;Adresse;Telephone;Date de naissance;Ville
Jin;Kazama;Moka;56656496;7/11/1989;Pamplemousses
Naruto;Uzumaki;Triolet;56461654;2/12/1989;Pamplemousses
Paul;Phoenix;Soulliac;97146665;23/08/1987;Pamplemousses

 

 

Bad file :

 

Nom;Prenom;Adresse;Telephone
Jin;Kazama;Moka;56656496
Naruto;Uzumaki;Triolet;56461654
Paul;Phoenix;Soulliac;97146665
Nom;Prenom;Adresse;Telephone;Date de naissance;Ville
Jin;Kazama;Moka;56656496;7/11/1989
Naruto;Uzumaki;Triolet;56461654;2/12/1989;Pamplemousses
Paul;Phoenix;Soulliac;97146665;23/08/1987;Pamplemousses
Nom;Prenom;Adresse;Telephone;Date de naissance;Ville
Jin;Kazama;Moka;56656496;7/11/1989;Pamplemousses
Naruto;Uzumaki;Triolet;56461654;2/12/1989;Pamplemousses
Paul;Phoenix;Soulliac;97146665;Pamplemousses

 

Can you advice please?

 

Best regards,

asadasing

Labels (3)
1 Solution

Accepted Solutions
Anonymous
Not applicable

Hi,

 

In the tfileInputDelimited, in advanced settings select the option "Check each row structure against schema". Now take rejects from tfileInputDelimited. If there is any mismatch in number of columns the rows will be rejected.

 

You can count the rows in reject file, if there are any rows you can stop the process. I hope this will help.

 

Regards

Ravinder

View solution in original post

2 Replies
TRF
Champion II
Champion II

Hi,
As a basic solution, you can use tFileIinputFullRow, then count the number of field separators to exclude incorrect records.
Anonymous
Not applicable

Hi,

 

In the tfileInputDelimited, in advanced settings select the option "Check each row structure against schema". Now take rejects from tfileInputDelimited. If there is any mismatch in number of columns the rows will be rejected.

 

You can count the rows in reject file, if there are any rows you can stop the process. I hope this will help.

 

Regards

Ravinder