Re: filter with a tab character
Hi Hugh, Am 04.02.2013 um 18:04 schrieb FlexibleLearning.com ad...@flexiblelearning.com: I have tab-delimited list and am trying to filter lines. Q1. How do we include a TAB character in the expression? Using filter with *\tsomeText fails. use the contant TAB: ... filter tList with (* TAB whatever) ... Q2. How do we specify a maximum numeric value? Using filter with *[18] fails. Sorry, no idea. Maybe with some RegeEx? Have tried reading up on Bourne Shell but am totally confused! Thanks. Hugh Senior FLCo Best Klaus -- Klaus Major http://www.major-k.de kl...@major.on-rev.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: filter with a tab character
Klaus wrote: Am 04.02.2013 um 18:04 schrieb FlexibleLearning.com: I have tab-delimited list and am trying to filter lines. Q1. How do we include a TAB character in the expression? Using filter with *\tsomeText fails. use the contant TAB: ... filter tList with (* TAB whatever) While the filter command is seductively simple to use, if your rows have many columns and you're filtering on one several columns in, you may find repeat for each will be more efficient: http://article.gmane.org/gmane.comp.ide.revolution.user/72192/match=filter+tab+gaskin -- Richard Gaskin Fourth World LiveCode training and consulting: http://www.fourthworld.com Webzine for LiveCode developers: http://www.LiveCodeJournal.com Follow me on Twitter: http://twitter.com/FourthWorldSys ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: filter with a tab character
I think you could also use \t to signify a tab char. As for the matching a range of numbers you'd probably be better served to have lc handle whatever is leftover. However, barring that, you might look at this page: http://www.regular-expressions.info/numericranges.html for an explanation of how to get it done. On Mon, Feb 4, 2013 at 10:09 AM, Klaus on-rev kl...@major.on-rev.comwrote: Hi Hugh, Am 04.02.2013 um 18:04 schrieb FlexibleLearning.com ad...@flexiblelearning.com: I have tab-delimited list and am trying to filter lines. Q1. How do we include a TAB character in the expression? Using filter with *\tsomeText fails. use the contant TAB: ... filter tList with (* TAB whatever) ... Q2. How do we specify a maximum numeric value? Using filter with *[18] fails. Sorry, no idea. Maybe with some RegeEx? Have tried reading up on Bourne Shell but am totally confused! Thanks. Hugh Senior FLCo Best Klaus -- Klaus Major http://www.major-k.de kl...@major.on-rev.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: filter with a tab character
filter searches for a pattern, not a value, so this can work to filter anything 'less than 18', but would work to filter results with the chars , 1 or 8. Paul On 2013-02-04, at 9:04 AM, FlexibleLearning.com wrote: Q2. How do we specify a maximum numeric value? Using filter with *[18] fails. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: filter with a tab character
Sorry, that should have read can't work not can work. On 2013-02-04, at 9:48 AM, Paul Hibbert wrote: filter searches for a pattern, not a value, so this can work to filter anything 'less than 18', but would work to filter results with the chars , 1 or 8. Paul On 2013-02-04, at 9:04 AM, FlexibleLearning.com wrote: Q2. How do we specify a maximum numeric value? Using filter with *[18] fails. ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: filter with a tab character
2013/2/4 FlexibleLearning.com ad...@flexiblelearning.com I have tab-delimited list and am trying to filter lines. Q1. How do we include a TAB character in the expression? Using filter with *\tsomeText fails. see \s below Q2. How do we specify a maximum numeric value? Using filter with *[18] fails. on mouseUp local tmp put fld 1 into tList -- \s match space and tab -- get \s[0-9]\s -- any 0 to 9 single number -- get \s[1-4][0-9]\s -- accept 10 to 49 -- get \s[1-4]\d\s -- accept 10 to 49 -- get \s[1-4]?\d\s -- accept 0 to 49 get \s[1-4]?(\d){1,3}\s -- accept 0 to 4999 repeat for each line L in tList if matchText( L, IT ) then put L cr after tmp end repeat put tmp end mouseUp Forget about filter; it doesn't play with regex, just sort of... my fld test contains: hjkdf sdfsdflkj 987dsf sdf sdf fgffg gf gf4998 fd ddf ddfd fgffg gf gf5000 fd ddf ddfd ere e re 1234567890e gfgjfkgf dfglwer 0 fdfsla sdfsdf gfgjfkgf dfglwer 42fdfsla sdfsdf try tytry retert 41dfsdffdsd sdflk; asdf 33dfdfdfsa dsfsdff kjklj jlkjlk 7ljlkj lkjkjlkj jljljkl And it's fast. HTH, Thierry ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: filter with a tab character
Forgot one which maybe you need: get \s([1-3]?\d|[4][0-2])\s -- accept 0 to 42 Regards, Thierry 2013/2/4 Thierry Douez th.do...@gmail.com 2013/2/4 FlexibleLearning.com ad...@flexiblelearning.com I have tab-delimited list and am trying to filter lines. Q1. How do we include a TAB character in the expression? Using filter with *\tsomeText fails. see \s below Q2. How do we specify a maximum numeric value? Using filter with *[18] fails. on mouseUp local tmp put fld 1 into tList -- \s match space and tab -- get \s[0-9]\s -- any 0 to 9 single number -- get \s[1-4][0-9]\s -- accept 10 to 49 -- get \s[1-4]\d\s -- accept 10 to 49 -- get \s[1-4]?\d\s -- accept 0 to 49 get \s[1-4]?(\d){1,3}\s -- accept 0 to 4999 repeat for each line L in tList if matchText( L, IT ) then put L cr after tmp end repeat put tmp end mouseUp Forget about filter; it doesn't play with regex, just sort of... my fld test contains: hjkdf sdfsdflkj 987dsf sdf sdf fgffg gf gf4998 fd ddf ddfd fgffg gf gf5000 fd ddf ddfd ere e re 1234567890e gfgjfkgf dfglwer 0 fdfsla sdfsdf gfgjfkgf dfglwer 42fdfsla sdfsdf try tytry retert 41dfsdffdsd sdflk; asdf 33dfdfdfsa dsfsdff kjklj jlkjlk 7ljlkj lkjkjlkj jljljkl And it's fast. HTH, Thierry ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: filter with a tab character
Thanks for the insights. Much appreciated. The list to filter is not enormous, but the 'for each' option would also handle any numeric evaluations, so both solutions will be valuable. Hugh Senior FLCo Klaus wrote: Am 04.02.2013 um 18:04 schrieb FlexibleLearning.com: I have tab-delimited list and am trying to filter lines. Q1. How do we include a TAB character in the expression? Using filter with *\tsomeText fails. use the contant TAB: ... filter tList with (* TAB whatever) Richard wrote: While the filter command is seductively simple to use, if your rows have many columns and you're filtering on one several columns in, you may find repeat for each will be more efficient: http://article.gmane.org/gmane.comp.ide.revolution.user/72192/match=filter +tab+gaskin ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode