Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #10892
    user
    Participant

    hello!

    can you help me please to make these macros:

    – delete everything included in brackets () including the brackets themselves

    – delete everything included in brackets [] including the brackets themselves

    – delete everything after the first ( in everyline, including the bracket itself

    – delete double or more spaces (not tabs) and replace them with one space

    – replace the text of each line with the url of the first google result of the search of that text

    – replace the text of each line with the http://www.domain.com/ of the first google result of the search of that text (not the first url, which can be http://something.domain.com/something/more, but the http://www.domain.com/ only)

    thanks!

    #10894
    Stefan
    Participant

    .

    Please try to find better subject lines for your threads
    and use different threads for different kind of topics.

    .

    To do most of this, best learn Regular Expressions.

    For example on:
    – delete everything included in brackets (xxx) including the (brackets) themselves

    Find: (.+?)
    Replace:
    [X] Use Regular Expressions

    will match first
    (xxx)
    and then
    (brackets)

    due to the ‘?’ regex parameter.

    Whereas

    Find: (.+)
    Replace:
    [X] Use Regular Expressions

    will match whole
    (xxx) including the (brackets)

    – – –

    For [ and ]
    use

    Find: [.+]
    Replace:
    [X] Use Regular Expressions

    – – –

    – delete everything after the first ( in everyline, including the bracket itself

    Try
    Find: (.+$
    Replace:
    [X] Use Regular Expressions

    – – –

    – delete double or more spaces (not tabs) and replace them with one space

    Try
    Find: ~~+
    Replace: ~
    [X] Use Regular Expressions

    (instead of ‘~’ enter an blank each)

    – – –

    To create a macro try to utilize
    – “Macro > Start”
    – do the work, here the find and replace job
    – “Macro > Stop”
    – “Macro > Edit” –> you will see the macro code to reuse
    (you may want to read the help about e.g. “eeFindSaveHistory” and remove this from the macro)

    – – –

    For the other questions *I* suggest you to open different threads
    for each topic to not mix up all the answers and queries and for an back.

    _

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.