Replace character with a number sequence in Notepad++ -
i have huge text file following pattern has been repeated till end of file:
--- 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
what need replace '---' number sequence starting 1 , incremented 1 i.e.:
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
use one-by-one replacement:
enter dash in find:
---
enter first number in replace:
1-
use alt+r replace. keep focus in replace field, allowing change number easily.
use macro record future reference.
references
Comments
Post a Comment