Filtering Columnar Data

Mark Schonewille m.schonewille at economy-x-talk.com
Mon Jul 16 12:06:28 EDT 2007


Hi Gregory,

You need to include all trailing tabs to make 56 columns (that would  
be 55 tabs). That should work, but I experienced crashes when doing  
this. You need to stress-test this feature before distributing your  
software, if you plan to distribute it.

In this case, a sqLite or mySql database might be more reliable and  
easier in the long term, depending on the size of your data.

As you suggested yourself, an alternative might be to filter the data  
to include all lines containing the number you are searching for and  
do a repeat loop on the remaining data.

Best regards,

Mark Schonewille

--

Economy-x-Talk Consulting and Software Engineering
http://economy-x-talk.com
http;//www.salery.com

Quickly extract data from your HyperCard stacks with DIFfersifier.  
http://differsifier.economy-x-talk.com


Op 16-jul-2007, om 17:58 heeft Gregory Lypny het volgende geschreven:

> 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
>
>
>




More information about the use-livecode mailing list