Re: Expunging Char (0)
L Lo wrote: >It's not our fault Americans can't spell. >:-) Yeah, I know, like, right? Some of us still put extra letters like "ugh" in tho. How brown is your cow now? (That last sentence is silent.) -- -- Tom Dillon 825 N. 500 W. DataCraft Moab, UT 84532 tomdil...@datacraft-inc.com 720/209-6502 -- First, get your facts straight. Then you can manipulate them all you want. --- Mark Twain -- ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
RE: Expunging Char (0)
https://pbs.twimg.com/media/CRchX5dW0AAUWag.jpg:large LOL On Thu, 22 Sep 2016 14:45:17 +, Lo wrote: > Hey Chip > > It's not our fault Americans can't spell. > :-) > > Love and kisses > Lo > >> no... >> but it probably adds a bunch of "u"s to words, like color (colour) > >> 8) > > On Wed, 21 Sep 2016 16:14:25 -0700, Douglas von Roeder wrote: >> >> Since Pat's from the UK, does it left-justify the text? ;-) > ** > 4D Internet Users Group (4D iNUG) > FAQ: http://lists.4d.com/faqnug.html > Archive: http://lists.4d.com/archives.html > Options: http://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:4d_tech-unsubscr...@lists.4d.com > ** > ** > 4D Internet Users Group (4D iNUG) > FAQ: http://lists.4d.com/faqnug.html > Archive: http://lists.4d.com/archives.html > Options: http://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:4d_tech-unsubscr...@lists.4d.com > ** ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
RE: Expunging Char (0)
Hey Chip It's not our fault Americans can't spell. :-) Love and kisses Lo > no... > but it probably adds a bunch of "u"s to words, like color (colour) > 8) On Wed, 21 Sep 2016 16:14:25 -0700, Douglas von Roeder wrote: > > Since Pat's from the UK, does it left-justify the text? ;-) ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com ** ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: Expunging Char (0)
Doug, if I am reading this correctly (http://kb.4d.com/resources/inug?msgid=GmailId14980bbd87790d18 ) - Keisuke is saying... SET TEXT TO PASTEBOARD($text) $text:=Get text from pasteboard apply to your text field(s) Also I found this on game (12 years ago - from Pat Bensky) Here is some code to strip gremlins. You might not need some bits - e.g., the removal of leading and trailing spaces. ` GremlinsRemove ` 29/01/02 pb ` Deletes "gremlins" from text -- e.g. ` embedded tabs, spaces at beg. or end, line ends etc. ` parameters: $1 = pointer to the data to be checked ` (could be a field or variable) C_TEXT($text;$tOutput) C_LONGINT($i;$length;$type) $type:=Type($1->) If (($type=Is Text ) | ($type=Is Alpha Field ) | ($type=Is String Var )) If (Length($1->)>0) $text:=$1-> ` first remove leading spaces While (Ascii($text¾1)=32) $text:=Substring($text;2) End while ` then remove all trailing spaces While (Ascii($text¾Length($text))=32) $text:=Substring($text;1;Length($text)-1) End while ` Then remove all embedded gremlins ` Nothing below ASCII 32 (space) should be allowed, except ` 13 (CR) but only in text, not strings $length:=Length($text) $tOutput:="" For ($i;1;$length) Case of : (($type=Is Text ) & (Ascii($text¾$i)=13)) ` this is allowed $tOutput:=$tOutput+$text¾$i : (Ascii($text¾$i)=13) $tOutput:=$tOutput+" " : (Ascii($text¾$i)<32) ` not allowed Else $tOutput:=$tOutput+$text¾$i End case End for $1->:=$tOutput End if ` length > 0 End if ` type = text or string On Wed, 21 Sep 2016 14:19:14 -0700, Douglas von Roeder wrote: > I've hit a situation in a legacy application that has records with alpha > and text fields that contain numerous non-printing characters. The > non-printing characters are causing non-printing. > > How do I go about finding the records the have invalid characters and > deleting the Char(0)? > > One approach would be Query by formula checking to see if the position of > Char(0)>0 but that seems to be a painfully resource intensive approach. > > Another tack would be to update the trigger code but that means I only get > cleaned up data if the record is modified. > > Thoughts, comments, suggestions, etc. on this issue are welcome. > > -- > Douglas von Roeder > 949-336-2902 > ** > 4D Internet Users Group (4D iNUG) > FAQ: http://lists.4d.com/faqnug.html > Archive: http://lists.4d.com/archives.html > Options: http://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:4d_tech-unsubscr...@lists.4d.com > ** ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Re: Expunging Char (0)
Doug, this might be more then you think... as I recall there are a number of non-printing characters in unicode char(0) through char(31) except Char(10), char(13) so it may not be a "simple" Query by formula([table];position(char(0);[table]field)>0) It may actually be a case of do any of the characters in any text field in my database match any of these prohibited characters in this list. I had some old code to locate and exterminate gremlins (same idea, older systems) but it does not seem to be handy. That code may have come from the nug, you could check the archives... If i find it - I'll forward it to you. Chip On Wed, 21 Sep 2016 14:19:14 -0700, Douglas von Roeder wrote: > I've hit a situation in a legacy application that has records with alpha > and text fields that contain numerous non-printing characters. The > non-printing characters are causing non-printing. > > How do I go about finding the records the have invalid characters and > deleting the Char(0)? > > One approach would be Query by formula checking to see if the position of > Char(0)>0 but that seems to be a painfully resource intensive approach. > > Another tack would be to update the trigger code but that means I only get > cleaned up data if the record is modified. > > Thoughts, comments, suggestions, etc. on this issue are welcome. > > -- > Douglas von Roeder > 949-336-2902 > ** > 4D Internet Users Group (4D iNUG) > FAQ: http://lists.4d.com/faqnug.html > Archive: http://lists.4d.com/archives.html > Options: http://lists.4d.com/mailman/options/4d_tech > Unsub: mailto:4d_tech-unsubscr...@lists.4d.com > ** ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **
Expunging Char (0)
I've hit a situation in a legacy application that has records with alpha and text fields that contain numerous non-printing characters. The non-printing characters are causing non-printing. How do I go about finding the records the have invalid characters and deleting the Char(0)? One approach would be Query by formula checking to see if the position of Char(0)>0 but that seems to be a painfully resource intensive approach. Another tack would be to update the trigger code but that means I only get cleaned up data if the record is modified. Thoughts, comments, suggestions, etc. on this issue are welcome. -- Douglas von Roeder 949-336-2902 ** 4D Internet Users Group (4D iNUG) FAQ: http://lists.4d.com/faqnug.html Archive: http://lists.4d.com/archives.html Options: http://lists.4d.com/mailman/options/4d_tech Unsub: mailto:4d_tech-unsubscr...@lists.4d.com **