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

Announcements
Write Table now available in Qlik Cloud Analytics: Read Blog
cancel
Showing results for 
Search instead for 
Did you mean: 
JDzielski
Contributor
Contributor

Extracting datasets from a csv file

I have csv file with three datasets included one below another with different number of column each:

header_1_column_1, header_1_column2, ..., header_1_column_n

data1_1_1, data1_1_2, ..., data1_1_n

...

data1_m_1, data1_m_2, ..., data1_m_n

header_2_column_1, header_2_column2, ..., header_2_column_k

data2_1_1, data2_1_2, ..., data2_1_k

...

data2_l_1, data2_l_2, ..., data2_l_k

header_3_column_1, header_3_column2, ..., header_3_column_i

data3_1_1, data3_1_2, ..., data3_1_i

...

data3_j_1, data3_j_2, ..., data3_j_i

My goal is to extract these three data sets to feed three sql tables. I thing about a process:

tFileInputDelimited -> tJava -> tSampleRow -> tmap -> tDBOutput

But I have a problem with determining the row number of the second and third header of datasets and the total number of records from the csv file in the tJava component, to pass these parameters to the tSampleRow component and extract these three datasets. Is it possible to determine the line number in the csv file based on the first occurrence of a given string? - the headers of the three data sets are constant.

Labels (3)
1 Reply
manodwhb
Champion II
Champion II

@Jan Dzielski​ ,check this link will help you (tFileInputMSDelimited).

 

https://help.talend.com/r/mjoDghHoMPI0yuyZ83a13Q/h96fJIR4IB9eloK9ZcSiOA

 

 

Thanks,

Manohar