Replacing every x row

Replacing every x row

3
NewbieNewbie
3

    Jul 22, 2005#1

    I currently have a list of names that I am attemping to sort out but there are some random areas with breaks and I am trying to add a a line to every so many rows in order to separate it all. I'm really new to this and am not quite sure I understand all of the descriptions for the symbols functions. Any help is much appreciated.

    I basically wanted it to go from

    Code: Select all

     1 Name:	namehere
     2 Type:	type
     3 OfficeAddress:	company
     4 street
     5 city,state,zip
     6 
     7 OfficePhone:	555-555-5555
     8 Fax:	555-555-5555
     9 
    10 Email:	
    11 Website:	
    12 
    to

    Code: Select all

     1 Name:	namehere
     2 Type:	type
     3 OfficeAddress:	company
     4 street
     5 city,state,zip
     6 
     7 OfficePhone:	555-555-5555
     8 Fax:	555-555-5555
     9 
    10 Email:	
    11 Website:	
    12 ----

    206
    MasterMaster
    206

      Jul 25, 2005#2

      Here's a quick and dirty macro:


      InsertMode
      ColumnModeOff
      HexOff
      UnixReOn
      Top
      Loop
      Key DOWN ARROW
      Key DOWN ARROW
      Key DOWN ARROW
      Key DOWN ARROW
      Key DOWN ARROW
      Key DOWN ARROW
      Key DOWN ARROW
      Key DOWN ARROW
      Key DOWN ARROW
      Key DOWN ARROW
      Key DOWN ARROW
      Key END
      " ----"
      Key DOWN ARROW
      Key HOME
      IfEof
      ExitLoop
      EndIf
      EndLoop



      If all the lines you want to change start with "12", a regular expression search and replace would be much faster. You wouldn't even need a macro.

      InsertMode
      ColumnModeOff
      HexOff
      UnixReOn
      Top
      Find RegExp "^[1][2]"
      Replace All "12 ----"
      Software For Metalworking
      http://closetolerancesoftware.com

      3
      NewbieNewbie
      3

        Jul 25, 2005#3

        Oh thanks a ton, much appreciated, that worked great. What I meant was that every twelve rows needed it so doing it the other way would have meant replacing each number written.

        Thanks again!