我有一个巨大的文本文件,其中包含以下模式,该文件一直重复到文件末尾:
--- 3DModelImport
ModelKey nvarchar
TagNo nvarchar
Type nvarchar
LocationDwg nvarchar
SignalType nvarchar
JunctionBoxNo nvarchar
PlantXYZ nvarchar
RowGuidID uniqueidentifier
--- 3DModelInterface
DbKey int
TagNo nvarchar
AreaUnit nvarchar
Type nvarchar
Description nvarchar
ParentDbKey int
SignalType nvarchar
JunctionBoxKey int
LocationDwg nvarchar
PlantCoordX real
PlantCoordY real
PlantCoordZ real
ModelKey nvarchar
SizeX real
SizeY real
SizeZ real
FromDb datetime
From3DModel datetime
psize_ts timestamp
RowGuidID uniqueidentifier
--- AccessTypeEnum
AccessTypeEnumID int
Description nvarchar
RowGuidID uniqueidentifier
我需要做的是用从1开始的数字序列替换所有' --- '并加1,即:
1- 3DModelImport
ModelKey nvarchar
TagNo nvarchar
Type nvarchar
LocationDwg nvarchar
SignalType nvarchar
JunctionBoxNo nvarchar
PlantXYZ nvarchar
RowGuidID uniqueidentifier
2- 3DModelInterface
DbKey int
TagNo nvarchar
AreaUnit nvarchar
Type nvarchar
Description nvarchar
ParentDbKey int
SignalType nvarchar
JunctionBoxKey int
LocationDwg nvarchar
PlantCoordX real
PlantCoordY real
PlantCoordZ real
ModelKey nvarchar
SizeX real
SizeY real
SizeZ real
FromDb datetime
From3DModel datetime
psize_ts timestamp
RowGuidID uniqueidentifier
3- AccessTypeEnum
AccessTypeEnumID int
Description nvarchar
RowGuidID uniqueidentifier
答案 0 :(得分:0)
使用逐个替换:
在查找中输入短划线:
---
在替换中输入第一个数字:
1-
使用 Alt + R 进行替换。这将使焦点保持在替换字段中,允许您轻松更改数字。
使用宏记录此信息以供将来参考。
<强>参考强>