Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.



Re: find a string from another string.
Posted:
Nov 15, 2012 2:56 AM


"Nasser M. Abbasi" <nma@12000.org> wrote in message <k823hv$4i7$1@speranza.aioe.org>... > On 11/15/2012 12:49 AM, Moon Datta wrote: > > I have a string like below, > > > > 'N6E01110925D00ASYWDCC2KYOTO' > > 'N6E01110925D01ASYWDCC2KYOTO' > > '.................................................... > > .................................................... > > 'N6E01110925H00ASYWDCC2KYOTO' > > 'N6E01110925H01ASYWDCC2KYOTO' > > ' > >  > > 'N6E01110925D00SYMWDCC2KYOTO' > > 'N6E01110925D01SYMWDCC2KYOTO' > >  > >  > > 'N6E01110925H00SYMWDCC2KYOTO' > > 'N6E01110925H01SYMWDCC2KYOTO' > > > > The above is not a string. > > Can you show the data structures that contains all of the above in it? > > Is it in cell array? One should post here a complete working code. > > either way, may be findstr() can help. > > > Nasser
Sir,
This is a textdata{} , <288x1 cell>
like 'N6E01110926H08ASYWDCC2KYOTO' 'N6E01110926H09ASYWDCC2KYOTO' 'N6E01110926H10ASYWDCC2KYOTO' 'N6E01110926H11ASYWDCC2KYOTO' 'N6E01110926H12ASYWDCC2KYOTO' 'N6E01110926H13ASYWDCC2KYOTO' 'N6E01110926H14ASYWDCC2KYOTO' 'N6E01110926H15ASYWDCC2KYOTO' 'N6E01110926H16ASYWDCC2KYOTO' 'N6E01110926H17ASYWDCC2KYOTO' 'N6E01110926H18ASYWDCC2KYOTO' 'N6E01110926H19ASYWDCC2KYOTO' 'N6E01110925H00SYMWDCC2KYOTO' 'N6E01110925H01SYMWDCC2KYOTO' .............................................. ...................................................
like I have stated above. As in the above cells in 13 number row there is H and SYM. The program will give me those index number of the text data whose have the H ans SYM string in it. Here it is 13,14. Hope I am clear to you.
For these problem I have tried findstr(). But it works for the full contents of a cell like N6E01110926H20ASYWDCC2KYOTO. I want to compare only 'H20ASY' which is in the middle part of the cell.



