Filtering Columnar Data
Chris Sheffield
cmsheffield at gmail.com
Mon Jul 16 12:18:06 EDT 2007
Gregory,
Try this and see if it works.
filter tmpData with "*" & tab & myNumber & tab & "*"
There shouldn't be any need to include the preceding or trailing
tabs, except for the ones directly surrounding the number.
Chris
On Jul 16, 2007, at 9:58 AM, Gregory Lypny wrote:
> Hello Everyone,
>
> I'm struggling with the filter command. I have tab-delimited data
> in a field, where each row has at least 56 columns. I want to
> filter the data based on a chosen number in that fourth column, for
> example, to return all lines that have a 9 there. The fourth
> column only contains a number from 1 to 10. The following handler
> works most of the time. I put three wild card expressions, lone
> asterisks separated by tabs, to make sure nothing is being picked
> up in the first three columns. The tab and asterisk (and it could
> be just an *) following myNumber says that it doesn't matter what
> is in the columns after the fourth.
>
> put fld "Data" of this card into tmpData
> filter tmpData with "*" & tab & "*" & tab & "*" & tab & myNumber &
> tab & "*"
>
> The trouble is, the first three wild card expressions are
> interpreted by Revolution to include tab characters, which means
> that I'm not necessarily filtering the fourth column! If a 9
> appears by itself in column 58, then the filter command will pick
> it up. Sigh.
>
> I also tried the following, but I don't think I have the regular
> expression syntax right.
>
> filter it with "[A-Z0-9]" & tab & "[0-9]" & tab & "[A-Z]" & tab
> & myNumber & tab & "*"
>
> I know that my first column always contains five words, two of
> which are numbers. I wasn't sure how to represent the four spaces
> between the words. The second column is always a seven-digit
> number. The third contains first and last names, which will
> contain at least two words. This turns up empty.
>
> Any advice would be most appreciated. If I can't get the RegEx
> working for me, I know I can resort to a repeat loop and pull out
> all lines with myNumber in the fourth item.
>
> Regards,
>
> Gregory
>
>
>
>
>
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
------------------------------------------
Chris Sheffield
Read Naturally
The Fluency Company
http://www.readnaturally.com
------------------------------------------
More information about the use-livecode
mailing list