PowerQuery如何在字符串中首次下部案例字母后删除文本
我有一个数据表,其中包含具有以下格式的多个单元格:
Pro-Plas Africa Explastic Machinery&材料展览。 Pro-Plas Africa Expo具有塑料加工机械,冷水机,转换设备,挤出设备,饲养器,加工辅助设备,回收设备,各种材料,吹塑机械,
我想转换绳子以从第一个下部案例字母中删除所有内容,所以我剩下的:
Pro-Plas Africa Expop
然后删除字符串中的最后一封信离开:
Pro-Plas Africa Expo
我尝试使用以下内容:
'#"Added Custom" = Table.AddColumn(#"Changed Type", "allCaps", each
Text.Combine(
List.Accumulate(Text.Split([Column1]," "),
{},
(state, current)=>
if List.ContainsAny(
Text.ToList(current),
{"0".."9","a".."z",",",":","?","/","\"," "})
then state
else state & {current}),", "))'
使用[Column1]代替相关表专栏,提供:
Pro-Plas Africa& Pro-Plas Africa Expo
我可以解决这是因为第一次出现“ Explastic”包含上层和下案字母。.
我也尝试了“ text.emove”以摆脱所有下部案例字母,但这留下了每个单词开始时的上案例:
Pro-Plas Africa Expop M& M E. Pro-Pro-Plas Africa Expo P,C,C,C,E,F,P,RV,B
最初的下部案例字母在每个细胞中处于不同的位置。
有解决方案吗?
I have a table of data which contains multiple cells with the following format:
PRO-PLAS AFRICA EXPOPlastic Machinery & Materials Exhibition. PRO-PLAS AFRICA EXPO features Plastics processing machinery, Chillers, Converting equipment, Extrusion equipment, Feeders, Processing aids, Recycling equipment, Various materials, Blow moulding machinery
I want to transform the string to remove everything from the first lower case letter, so I am left with:
PRO-PLAS AFRICA EXPOP
Then remove the last letter in the string to leave:
PRO-PLAS AFRICA EXPO
I have tried using the following:
'#"Added Custom" = Table.AddColumn(#"Changed Type", "allCaps", each
Text.Combine(
List.Accumulate(Text.Split([Column1]," "),
{},
(state, current)=>
if List.ContainsAny(
Text.ToList(current),
{"0".."9","a".."z",",",":","?","/","\"," "})
then state
else state & {current}),", "))'
with [column1] substituted for the relevant table column, which delivers:
PRO-PLAS AFRICA & PRO-PLAS AFRICA EXPO
I can work out that this is because the first occurrence of "EXPOPlastic" contains upper and lower case letters..
I have also tried "text.remove" to get rid of all lower case letters, but this leaves the upper case at the start of each word giving:
PRO-PLAS AFRICA EXPOP M & M E. PRO-PLAS AFRICA EXPO P, C, C, E, F, P, R V , B
The initial lower case letter is in a different position in each cell.
is there a solution to this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试
Try