>Hi, I have multiple text strings consisting of two words
>separated with a "tab" looking something like below:
>one two
>now how do you do to split this string to two separate
>strings, in this case it would be split to the strings 'one'
>and 'two'.
regexp(TheString, '([^ \t][^\t]*)', 'match')
This expression is a bit more complicated than is at first
obvious because I detect that there is a space after the tab
but your output does not want the space as part of the output string.
You have not specified, though, what you want to have happen if there
are spaces within the fields.

Signature
"Product of a myriad various minds and contending tongues, compact of
obscure and minute association, a language has its own abundant and
often recondite laws, in the habitual and summary recognition of
which scholarship consists." -- Walter Pater
Nitin Chhabra - 11 Jul 2008 07:05 GMT
roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson) wrote in
message <g55s9j$hhc$1@canopus.cc.umanitoba.ca>...
> >Hi, I have multiple text strings consisting of two words
> >separated with a "tab" looking something like below:
[quoted text clipped - 12 lines]
> You have not specified, though, what you want to have happen if there
> are spaces within the fields.
Hi,
If there are just two words, strtok could be used.
help strtok for more.
with regards,
Nitin
"Bamba Bolo":
<SNIP a matter of english...
> two words separated with a "tab" looking something like
below:
> one two
> now how do you do to split this string to two separate
> strings...
one of the many solutions
s=sprintf('one\ttwo three\tfour');
r=regexp(s,'\t','split')
% r = 'one' 'two three' 'four'
us