Re: Removing all NON numbers from a data element
Magicgate Software - Skip Kimpel skip@... writes: I have data element that I need to scan for all NON numbers and remove them. For instance this data element should read 0123456789 but sometimes is listed as 0123-4-5678-9 or has foreign characters in it or reads NOT AVAILABLE. so: if item 14 of tLine number then There are about 500,000 rows of data to go through so my dilemma is to make the code as efficient as possible. Check out the new options for the filter command, especially the regex pattern matching. -- Mark Wieder ahsoftw...@gmail.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: Removing all NON numbers from a data element
Hi, This regex does what you want: on foo put 123-f-78-x0// into x put replacetext(x,[^0-9],) end foo Probably you will need a repeat loop, unless you really just have a list of 50 phone numbers. In that case you could use replacetext(x,[^0-9\n],) to modify the entire list at once. I don't know how long that would take, though. Just try it. -- Best regards, Mark Schonewille Economy-x-Talk Consulting and Software Engineering Homepage: http://economy-x-talk.com Twitter: http://twitter.com/xtalkprogrammer KvK: 50277553 Installer Maker for LiveCode: http://qery.us/468 Buy my new book Programming LiveCode for the Real Beginner http://qery.us/3fi LiveCode on Facebook: https://www.facebook.com/groups/runrev/ On 6/11/2014 20:23, Magicgate Software - Skip Kimpel wrote: Hello LC'ers I have data element that I need to scan for all NON numbers and remove them. For instance this data element should read 0123456789 but sometimes is listed as 0123-4-5678-9 or has foreign characters in it or reads NOT AVAILABLE. so: if item 14 of tLine number then There are about 500,000 rows of data to go through so my dilemma is to make the code as efficient as possible. Thank you for any input you might have! ___ 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: Removing all NON numbers from a data element
Use replaceText: put replaceText ( yourData, ^[0-9]*, empty) into yourData On Wednesday, June 11, 2014 2:25:11 PM, Magicgate Software - Skip Kimpel s...@magicgate.com wrote: Hello LC'ers I have data element that I need to scan for all NON numbers and remove them. For instance this data element should read 0123456789 but sometimes is listed as 0123-4-5678-9 or has foreign characters in it or reads NOT AVAILABLE. so: if item 14 of tLine number then There are about 500,000 rows of data to go through so my dilemma is to make the code as efficient as possible. Thank you for any input you might have! ___ 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: Removing all NON numbers from a data element
Another version.. put replacetext(tData,(?!\n)(\D),empty) If there are lines with no numbers at all the list will end up with some empties, but those can easily be filtered out after the replacetext. This replaces everything except the newline and digits ( \d matches a digit, \D matches all non-digits. (?!\n) is a NOT match to the newline. In my example, order matters, the \n check needs to be first) On Wed, Jun 11, 2014 at 12:50 PM, Alain Farmer alain_far...@yahoo.com wrote: Use replaceText: put replaceText ( yourData, ^[0-9]*, empty) into yourData On Wednesday, June 11, 2014 2:25:11 PM, Magicgate Software - Skip Kimpel s...@magicgate.com wrote: Hello LC'ers I have data element that I need to scan for all NON numbers and remove them. For instance this data element should read 0123456789 but sometimes is listed as 0123-4-5678-9 or has foreign characters in it or reads NOT AVAILABLE. so: if item 14 of tLine number then There are about 500,000 rows of data to go through so my dilemma is to make the code as efficient as possible. Thank you for any input you might have! ___ 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 ___ 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