如何删除数据中的额外管道 [英] How do I remove the extra pipe we have in the data

查看:62
本文介绍了如何删除数据中的额外管道的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有以下字符串 -



123|abc ||xyz|香蕉|Apple | Orange||||



我希望字符串在以下格式 -



123 | abc || xyz | banana | Apple Orange ||||



这意味着我基本上想要摆脱所有双引号()和Apple和Orange之间出现的额外管道(|)。



有点紧急,所以请求你帮助。

解决方案

因为它看起来像一个字符分隔,可变宽度文件中的一行,我假设你想得到的值,在这种情况下,你绝对不想做你描述的。



尝试使用RegularExpression:(^ | \G )((? 'quo'\)(? 'VAL'。*?)\k'quo')(\ ||





或者看看 Rive [ ^ ]



轻微修改:(^ | \ G)((?'quo'\)(? 'VAL'。*?)\k'quo')(\ ||


Hi,

I have the following string -

"123"|"abc"|""""|""xyz"|""banana"|"Apple | Orange"|""|||

and I want the string in the following format -

123|abc||xyz|banana|Apple Orange||||

that means basically i want to get rid of all double quotes (") and an extra pipe (|) which appears in between Apple and Orange.

Its bit urgent, so request you to kindly help.

解决方案

As that looks like a line from a Character-Separated, Variable-width file I'm assuming you will want to get the values, in which case, you absolutely do not want to do what you describe.

Try using a RegularExpression: (^|\G)((?'quo'\")(?'val'.*?)\k'quo')(\||


)

Or have a look at Rive[^]

Slight modification: (^|\G)((?'quo'\"?)(?'val'.*?)\k'quo')(\||


)


这篇关于如何删除数据中的额外管道的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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