Hi All,
I was given a task of generating a CSV file. I am facing some issues at this moment.
The problem statement goes something like this:
-
I am getting some data (preferably column wise from database), and this fetching of data happens at the runtime.
For example: I am passing the required column COLUMN_A_VAL, COLUMN_D_VAL, COLUMN_C_VAL, etc… to database to fetch the records. This fetching of the record is not in order, sometimes the order can be A,B and C. and sometimes, it is, C, B, A.
-
Once after getting the data from database tables, I am converting this to a string. And, I have the data in the string as follows:
Column A
data 1
data 2
data 3
data 4
.
.
.data n
-
Now, I will retrieve one more set of columns from DB table, say, Column B.
Column B
data 1
data 2
data 3
.
.
.data n
-
Finally, I need to generate the CSV file in a format like this:
Column A, Column B,
data 1, data 1
data 2, data 2
data 3, data 3,
…, …,
…, …,
data n, data n
My question here is: How can I append the data in a CSV file Column wise.
P.S.: I have tried “convertToString” service from flat-file package, But, this works for a predetermined columns.
But, what I have is, everytime I had to determine which column has the data, and particularly, fetch the data from that DB Table, and append it to the file.
Can someone throw some insights on to how to generate/append the string data into a CSV file column wise with comma as delimiter.
I have tried many options, but, couldn’t succeed still!! 
Regards,
Pradeep
#Flow-and-Java-services#Integration-Server-and-ESB#webMethods