如何以简单的方式alignment文本?
我有一个包含数千行的CSV
文件。 每行delimited by a semi-colon(;)
, starting with character <--
ending with character -->
。 比如像这样:
<--;2016;computer printer scaner; Computer hardwares;--> <--;2015;computer printer scaner;Computer hardwares;--> <--;2014;computer printer scaner;Computer hardwares;-->
我想编辑它看起来像这样:
<--;2016;computer printer scaner;Computer hardwares;--> <--;2015;computer printer scaner;Computer hardwares;--> <--;2014;computer printer scaner;Computer hardwares;-->
通常我会一个一个手动地做多达数千行。 非常感谢你
这可以通过一个传球,使用后视 。
这将replace所有不在string-->
之后的换行符
- Ctrl + H
- find:
(?<!-->)\R
- replace为:
EMPTY
- 全部replace
说明:
(?<!-->) : negative lookbehind, make sure we don't have "-->" \R : any kind of line break
给定示例的结果:
<--;2016;computer printer scaner;Computer hardwares;--> <--;2015;computer printerscaner;Computer hardwares;--> <--;2014;computer printerscaner;Computer hardwares;-->
在记事本++
-
去找和replace。 find\ r和\ n的所有实例并replace为空(确保search模式设置为扩展)
-
find – >并用 – > \ nreplace
这应该显示为你的例子