Page 1 of 1

How to read comma delimited file in PL1

PostPosted: Wed May 19, 2010 11:41 pm
by gvkvarma
Hi,

How to read comma delimited file in PL1? Do know the length of the file ?
For example X = 'abc,bcde,12345.67,' Need to move VAL1 = abc , VAL2 = bcde and VAL3 = 12345.67


Thanks in advance
gvk

Re: How to read comma delimited file in PL1

PostPosted: Mon May 24, 2010 8:51 am
by Kim
Just quickly, if you know how many fields there are in each record - move the record to a char var variable, index for each comma and substr the field out. If you don't know how many fields or want to be safe always check the return value is > zero.
You can automate this by putting into a do while loop and updating the indexes at the bottom of each loop.

Hope that helps, Kim

Re: How to read comma delimited file in PL1

PostPosted: Tue May 25, 2010 12:28 am
by gvkvarma
Thanks Kim for your Help