MsPattangi
MsPattangi

Reputation: 11

Is there a way to fetch the header details alone from a CSV data source using WSO2 EI 6.6 - Data service(CSV)

I am trying to create a Data service using WSO2 EI 6.6 and the data source is a CSV file.

I am able to fetch all the data from the file if the output mapping is set (because I am aware of the header details/ column info).

However, my current requirement is to fetch the header details from the cvs file and based on that, The user would retrive data what ever is required.

Is there a way to fetch the header info of the csv file alone using wso2 ei 6.6 or any version for that matter ?

Upvotes: 1

Views: 112

Answers (1)

Dilan Premarathna
Dilan Premarathna

Reputation: 1294

I believe that you can achieve your requirement with the file connector. Since the headers of the CSV file are present in the first row you can use the read a line [1] operation of the file connector to read the first line.

[1]-https://docs.wso2.com/display/ESBCONNECTORS/Working+with+the+File+Connector#WorkingwiththeFileConnector-readALine

Upvotes: 0

Related Questions