From help-request at octave dot org Tue Sep 13 01:47:36 2005 Subject: Re: handling strings From: Stefan van der Walt To: Mike Miller Cc: Help-Octave List Date: Tue, 13 Sep 2005 08:38:40 +0200 Mike, To read in the data, you might want to take a look at 'textread' in octave-forge (recently, a C++ version was submitted). It shouldn't be difficult to modify it to do your string comparisons as well. Regards Stéfan On Mon, Sep 12, 2005 at 06:38:01PM -0500, Mike Miller wrote: > This is a seemingly simple problem but I find it hard to deal with in > Octave (probably because there is some neat trick that I don't know). > Here is the bare bones of it: > > I have a file with strings delimited by any number of consecutive spaces > and/or tabs. The line may be padded with some spaces or tabs at either > end that should be ignored. I want to be able to read in the file as an > array of strings. Is that even possible? > > Once I have the data in memory, I want to be able to find the array > elements containing strings that match other strings in the array. Let's > call the array "A". I would then want to do things like > > find(A==A(2,3)) ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------