SSIS 中的 SubString 帮助 [英] Help with SubString in SSIS

查看:25
本文介绍了SSIS 中的 SubString 帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我对 SSIS 中的子字符串函数(派生列)有一个小问题.

I have a little Problem with the SubString-Function in SSIS (Derived Column).

等等..
这是可能的输入字符串:

So on..
That are the possible Input Strings:

玩具|分类|汽车|乐高

Toys|Category|Cars|Lego

玩具|热门与新品|女孩与生活方式|娃娃

Toys|Hot&New|Girls&Lifestyle|Doll

玩具|新品

芭比娃娃|类别|移动

我需要过滤第二个|"之后的词.

I need to filter the word after the Second " | ".

第一种情况:汽车"

第二种情况:女孩与生活方式"

In the second case: "Girls&Lifestyle"

第三种情况:"

在第四种情况下:移动"

In the fourth case: "Mobile"

我的尝试是:SUBSTRING(Category,FINDSTRING(Category,"|",2)+1,FINDSTRING(Category,"|",3))

My try was: SUBSTRING(Category,FINDSTRING(Category,"|",2)+1,FINDSTRING(Category,"|",3))

它不起作用,因为 FINDSTRING(Category,"|",3) 给出了索引,但我需要单词的长度!!如何计算字符串中单词的字符数?

It doesn't work because the FINDSTRING(Category,"|",3) gives the index but I need the lenght of the Word!! How can i count the Characters of a word in a String?

感谢您的帮助,抱歉我的英语不好!!

Thank you for your Help and Sorry for my bad english!!

最好的问候亚历克斯

推荐答案

这应该可以满足您的需求...不过有点乱!

This should do what you want...a touch messy though!

SUBSTRING( Category, FINDSTRING( Category, "|", 2 )+1,FINDSTRING( Category, "|", 3 )-FINDSTRING( Category, "|", 2 )-1)

这篇关于SSIS 中的 SubString 帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆