Page 1 of 1

spliting a string in one column into many rows

Posted: Sun Apr 15, 2007 4:45 am
by rafik2k
Hi,
i have a requriement where i need to lists all the job in a project.
For this i have used DSGetProjectInfo(DSJ.JOBLIST) function in the transformer and capturing the output in one column in a comma delimated sequential file.

I am getting outpur like this
column1
=========
A,B,C,D,E,F etc

But i need output like following
column1
=====
A
B
C
D
E
F
etc

Please advise me how to acheive this.

thanks in advance

Regards,
Rafiq

Posted: Sun Apr 15, 2007 7:03 am
by chulett
This is answered in the FAQ forum. Basically all you need to do is replace the commas with the EOR characters for your O/S - in your case <CR><LF> pairs. Write out one record like that and it will read back in as many.

Use functions like Convert or EReplace along with CHAR(13):CHAR(10).

Posted: Sun Apr 15, 2007 8:39 am
by rafik2k
Hi Chulett,
Thanks for response.
One morething where to use Convert or EReplace function i mean in transformer or in basic routine

Thanks

Posted: Sun Apr 15, 2007 8:54 am
by chulett
Up to you, it can be done in either place. In this case it isn't complex enough that it must be done in a routine, so suggest you stick within the transformer.

Posted: Sun Apr 15, 2007 9:03 am
by chulett
This is the FAQ post I mentioned, in case you hadn't found it yet.

Posted: Sun Apr 15, 2007 11:17 am
by rafik2k
chulett wrote:This is the FAQ post I mentioned, in case you hadn't found it yet.
Thanks Chulett,
I implemented ur logic and it's working fine.

Once again thanking you.

Regards,
Rafiq