将特殊字符替换为 null
是否有任何函数可以将informatica中的特殊字符替换为null
如果我们使用replacestr函数,
,我认为我们应该指定所有特殊字符如下:replacestr(input,'!','~','@','#',' $','%','^','&','*',null)
但我们不知道输入的特殊字符是什么。
你能告诉我哪个功能合适吗?
Is there any function to replace the special characters by null in informatica
if we used replacestr function, i think we should specify all special characters
as follows replacestr(input,'!','~','@','#','$','%','^','&','*',null)
But we dont know what are teh special characters will be coming as input.
can u please let me know that which function will be suitable.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您尝试过 REG_MATCH(input,'[^a-zA-Z0-9]') 吗?
Did you try, REG_MATCH(input,'[^a-zA-Z0-9]') ?
抱歉这么晚才回答,我知道你可能不再需要它了..我刚刚看到这个问题。我建议您使用正则表达式来查找除字符/数字/空格/换行符之外的任何内容,并将它们替换为 null。这将是一个替换转换,其中的patternSearch为“您的正则表达式”,并且ReplaceWith字段为null。
我假设所有特殊字符都是除了我在正则表达式中提到的字符之外的所有字符。
Sorry for the late answer, I know you might not need it anymore .. I just seen this question. I suggest that you use a regular expression that looks for anything but chars/numbers/spaces/newlines and replace them with null. It will be a Replace transformation with the patternSearch "your regular Expression" and null for the field ReplaceWith .
I am assuming by all special characters are all characters besides what I mentioned in the Regular expression.
试试这个:
这将找到所有非打印字符并将它们替换为 null(我认为最好替换为 '',但这只是我的意见。Informatica 使用 POSIX 标准,因此您可以使用其他字符,例如 alnum, punct,无论你需要什么
。一个>
Try this:
This will find all non-print characters and replace them with null (I think it'd be better to replace with '', but thats just my opinion. Informatica uses POSIX-standard, so you can use others like alnum, punct, whatever you need.
http://en.wikipedia.org/wiki/Regular_expression#POSIX_Extended_Regular_Expressions