Replace exactely 5 times ^p

Replace exactely 5 times ^p

2
NewbieNewbie
2

    Jan 25, 2006#1

    Replace exactly 5 times ^p

    Hello

    I have a file who looks like this, and contains 2-100 blocks with each 5 lines.

    name: winstdvm1;
    server: winstdvm1;
    scheduled backup: Enabled;
    comment: ;
    Save operations: ;

    name: winstdvm2;
    server: winstdvm2;
    scheduled backup: Enabled;
    comment: ;
    Save operations: ;

    I like that to have all 5 lines of the first block in one line. This can be done
    by search: ^p and replace:

    Problem is that if I' am doing this all ^p are appended to end of the line instead on in the five lines in first, second block.

    It should look like this: (It should be 2 x one line)

    name: winstdvm1;server: winstdvm1;scheduled backup:... Enabled;comment: ;Save operations: ;
    name: winstdvm2;server: winstdvm2;scheduled backup:... Enabled;comment: ;Save operations: ;

    I didn't found how to search only ex: ^p(5) only replace 5 lines. I don't know right syntax.

    Somebody any idea ?

    Thanks

    6,686585
    Grand MasterGrand Master
    6,686585

      Jan 25, 2006#2

      The regular expression replace for this job in UltraEdit style is:

      Find What: %^(name:*^)^p^(server:*^)^p^(scheduled*^)^p^(comment:*^)^p
      Replace With: ^1^2^3^4

      And in Unix style:
      Find What: ^(name:.*)\p(server:.*)\p(scheduled.*)\p(comment:.*)\p
      Replace With: \1\2\3\4
      Best regards from an UC/UE/UES for Windows user from Austria

      2
      NewbieNewbie
      2

        Jan 25, 2006#3

        Thanks a lot Mofi. It works!
        honda

        206
        MasterMaster
        206

          Jan 25, 2006#4

          The regular expression replace for this job in UltraEdit style is:

          Find What: %^(name:*^)^p^(server:*^)^p^(scheduled*^)^p^(comment:*^)^p
          Replace With: ^1^2^3^4

          And in Unix style:
          Find What: ^(name:.*)\p(server:.*)\p(scheduled.*)\p(comment:.*)\p
          Replace With: \1\2\3\4


          Comparing these two, which accomplish exactly the same thing, is why I prefer the Unix style - just easier on my old eyes.
          Software For Metalworking
          http://closetolerancesoftware.com