Prev: Check Duplicate Entries in Matrix then remove all but one entry
Next: Help with modelink IM in simpower
From: per isakson on 29 Sep 2009 18:39 gregthom <gregthom99(a)yahoo.com> wrote in message <a883d102-e07f-458f-96df-22095d50cf60(a)k33g2000yqa.googlegroups.com>... > Greetings I have a lines simillar to these in my text file > > log-entry: 8954756>test case John Dr.,Pine Hooks Drive0t646pln,Left- > Wheel (rear) > log-entry: 054756>new case Peter PhD,Abe Falls LN23pl646pln,Right- > Wheel (rear) > ... > > > Now I need to scan the file for lines containing > > 'log-entry:' * 'Right-Wheel (rear)' > and > 'log-entry:' * 'Left-Wheel (rear)' > > In the above lines, * denotes anything. I am only interested in the > lines where both log-entry and 'Left-Wheel (rear)' appear. I was > thinking of doing this using regexp in matlab but it is not working as > I expect. > > I have tried things like these: > > [lm index ] = regexp(textbuffer,'log-entry: \w* Right-Wheel > (rear)','match','start') > > Can anyone suggest some things I might try ? > > Thank you > > Try replace "\w*" by ".+" meaning - any character - one or more. Not all characters you want to match with "\w*" are "word characters". /per |