UNSTRING performance issue



Given a delimited string of variable length (string-variable), suppose
you are interested in the nth value in the string.

I'm currently using the following solution:

MOVE "," TO delimiter-variable
MOVE 1 TO string-pointer

PERFORM n TIMES

UNSTRING
string-variable DELIMITED BY delimiter-variable
INTO
string-field
WITH POINTER
string-pointer
ON OVERFLOW
SET unstring-error TO TRUE
EXIT PERFORM
END-UNSTRING

END-PERFORM


Obviously, the larger the string, the slower the performance of this
command.

I'm wondering if there is a faster way to do this that I am as yet
unaware of?

Any thoughts/ideas are welcome.

Thanks in advance,
Chris

.



Relevant Pages

  • Re: Text Box Question
    ... string. ... I think I'm right in saying that the Split array does not contain the ... > BTW you can use InStrand Mid$to extract 'lines' ... > Public Function StrExtStr$(StringIn$, Delimiter$, Nth%) ...
    (comp.lang.basic.visual.misc)
  • Re: General UNIX puzzle
    ... >standard UNIX tools, and am curious what answers people on the list might ... >1) Delete the Nth line from a text file? ... >2) Insert a specified line in a file after the Nth line, leaving the rest ... >3) Delete the first line containing a particular string? ...
    (freebsd-questions)
  • Re: can someone please help me with making this class
    ... struct and another I put the insert in. ... string phoneNo; ... node *temp, *prev; ...
    (microsoft.public.vc.language)
  • Re: Handling Large files (a few Gb) in Perl
    ... search through each string looking for a specific character. ... my $prev = 0; ... sub use_length { ... Rate index length ...
    (comp.lang.perl.misc)
  • CSV values and retrieiving nth item
    ... I have a set of data in a cell that is comma delimited (more specifically - ... I want to select the nth item in each string. ... to an array via an array formula: ...
    (microsoft.public.excel.worksheet.functions)