Thank you to all.  In particular, how can the indices of the matching lines 
be returned - I've a matlab background so am used to working from the 
indices.


On Thursday, December 3, 2015 at 8:52:34 PM UTC+1, Jason McConochie wrote:
>
> Is there grep for an Array of AbstractStrings?  See code below
>
>
> # A. Read a file into memory (nLines pre-determined)
>
> fID=open(fName)
>
> iLine=0;
>
> rLines=Array(ASCIIString,nLines);
>
> while !eof(fID)
>
>   iLine+=1
>
>   rLines[iLine]=readline(fID)
>
> end
>
>
> # B. Find all strings in rLines with "parameter"
>
> ???? Is something like this possible?
>
> indices=grep(rLines,r"parameter")
>
>
>
>

Reply via email to