Insert words at start and end of a line

Insert words at start and end of a line

2
NewbieNewbie
2

    Jul 09, 2006#1

    Hi

    I'm new with UltraEdit, I was using other for 2 years now.
    I need help with 2 things.

    1) How can I remove ASCII from a text?

    2) How can I insert words at the beginning and end of each line?

    This editor is great to use at work but I can't manage to do those things :(

    Thanks in advance.

    Sorry my bad English.

    6,675585
    Grand MasterGrand Master
    6,675585

      Jul 10, 2006#2

      1) I don't understand your question. Deleting characters can be done like in every other text editor.

      2) This could be done with a regular expression described several times in the forum. Here is once again the solution for UltraEdit style:

      Find What: %^(*^)$
      Replace With: your words^1your words

      The same regular expression replace in Unix or Perl style:

      Find What: ^(.*)$
      Replace With: your words\1your words

      See help of UltraEdit about the Find command and Regular Expressions for an explanation.
      Best regards from an UC/UE/UES for Windows user from Austria

      2
      NewbieNewbie
      2

        Jul 11, 2006#3

        That's not what I mean.

        I'll give you an example.

        Imagine an info from some scene team. The have all those ASCII.
        What I want is remove all those ASCII and keep just the text.

        The other question is simple. I just want to know how insert text at the beginning and end of each line.

        Ex:

        line 1
        line 2
        line 3
        ...

        What I want to do is insert "example" like this:

        example line 1
        example line 2
        example line 3
        ...

        But with thousands of lines.

        Thanks for your reply.

        6,675585
        Grand MasterGrand Master
        6,675585

          Jul 12, 2006#4

          Enlightned wrote:Imagine an info from some scene team. The have all those ASCII. What I want is remove all those ASCII and keep just the text.
          ASCII is the name of a standard and not a set of characters. To remove all unwanted characters use following regular expression.

          Find What: [...]
          Replace With: nothing

          The ... is just a place holder for all the characters you want to delete. Copy and paste them into it. You can also use the invert character set and delete all characters except ... This can be done in UltraEdit style with

          Find What: [~0-9A-Z ^t^p_,.;^*:...]
          Replace With: nothing

          Again ... is just a place holder for further standard characters. Use View - ASCII Table to get an overview of the characters and read carefully the whole help about the Find Command and Regular Expressions.
          Enlightned wrote:The other question is simple. I just want to know how insert text at the beginning and end of each line.
          And this question I have answered already.

          You should execute the replace commands with click on button Replace All and not step by step.
          Best regards from an UC/UE/UES for Windows user from Austria

          3
          NewbieNewbie
          3

            Jul 13, 2006#5

            To add the word "Example" at the start of each line:
            Replace ^p with ^pExample

            To put it at the end of the line:
            Replace ^p with Example^p

            ^p designates a hard return (DOS/Windows line ending, i.e. carriage return + line-feed).

            6
            NewbieNewbie
            6

              Jul 25, 2006#6

              Mofi is right.
              For example: I want to insert "start" at the beginning and "end" at the end of every line.

              InsertMode
              ColumnModeOff
              HexOff
              UnixReOff
              Find RegExp "%^(*^)$"
              Replace All "start ^1 end"

              As following:

              line1: a
              line2: b
              line3: c
              line4: d

              The result is:

              line1:start a end
              line2:start b end
              line3:start c end
              line4: d  

              But I don't understand why the last line is not processed.

              206
              MasterMaster
              206

                Jul 25, 2006#7

                Make sure there's a return at the end of the last line.
                Software For Metalworking
                http://closetolerancesoftware.com