Welcome Guest! To enable all features please Login or Register.
Go to last post Go to first unread
#1 Posted : Thursday, August 20, 2015 11:00:59 AM(UTC)

Rank: Administration

Groups: Administrators
Joined: 8/17/2015(UTC)
Posts: 22

Was thanked: 2 time(s) in 2 post(s)
A frequent problem with data migrations is text data with illegal characters in it. For example, the GoldMine notes fields sometimes contains NULL characters (binary 0), which can be problematic when inserting the data into SQL Server.

Inaport provides the snip() function, which can be used to remove characters or strings from a field. For example:
snip("aa111bb", "1")

will remove the "1" characters from the string, returning "aabb".

The characters to be snipped can be built from a regular expression. In particular, \xNN allows you to specify the binary value of any character. Examples:
\x00  -  NULL
\x0A  -  Carriage Return
\x0D  -  Line Feed

So to snip the NULL character from a field, do:
snip(#myField, "\x00")

If you need to remove a range of characters, use the regular expression "[]" construct, which allows you to specify a set or range of characters:
[\x00\x02]  -  specifes the characters \x00 and \x02
[\x00-\x08]  -  specifies all characters between \x00 and \x08

So to snip a range of characters fro the field, do:
snip(#myField, "[\x00-\x08]+")

Users browsing this topic
Guest (2)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF | YAF © 2003-2021, Yet Another Forum.NET
This page was generated in 0.071 seconds.