• Compare a whole file with several files / a directory

    5
    0 Votes
    5 Posts
    3k Views
    Stephan RS

    Hi @guy038
    this is working perfectly! Many thanks for the work that you put in my special (and probably unique) query! You saved my day! ((:

    Best Regards,
    Stephan

  • Is there any plugin to search specific word within the specific method?

    4
    2 Votes
    4 Posts
    1k Views
    guy038G

    Hi, @publicst, @claudia-frank and All,

    A similar and more simple regex could be :

    SEARCH (?s-i)void method[^}]+for.+?\}

    Cheers,

    guy038

  • Deleting all numbers with specific letter(s)

    Locked
    8
    0 Votes
    8 Posts
    2k Views
    Berniukas NeziniukasB

    @guy038 Sorry for being unclear! Sometimes I read my older posts and wonder how people managed to find any sense in them. That’s why I post so rarely…

  • Regex: Find words between words

    Locked
    4
    2 Votes
    4 Posts
    2k Views
    Vasile CarausV

    thank you

    also,

    a(\W+\w+){1,6}\W+for

  • Seperate a format in rows

    Locked
    3
    0 Votes
    3 Posts
    863 Views
    guy038G

    Hello @ph0enix, @Scott-sumner and All,

    if the general template of your data is always :

    ........@..........;......

    Here are, below, 3 other possible regex S/R. Similarly to Scott’s post, you must select the Regular expression search mode, tick the Wrap around option and click on the Replace All button. Note that the Replace with: zone is always Empty

    First regex :

    SEARCH (?-s)@.+

    REPLACE Empty

    Results :

    123.456.78.0:22000 12.3.456.789:10000

    Second regex :

    SEARCH (?-s).+?@|;.+

    REPLACE Empty

    Results :

    Name\Name123 NAME\Name-1

    Third regex :

    SEARCH (?-s).+;

    REPLACE Empty

    Results :

    name Name2017

    Best Regards,

    guy038

  • Delete Individual Lines in Multiple Files based on a List

    Locked
    3
    1 Votes
    3 Posts
    2k Views
    Darren WhiteD

    Scott, Thank you. I knew there would be a way and I almost knew it would be something in a regular expression, but only gods like yourself would know what to do. I really like the idea of a delimeter and then using the search to match any above and below the line.

    I did not get the chance to try this (although I can’t see why it wouldn’t work) as I thought of an alternative, which was to use Excel and a formula. I managed to open each of my 5 files in one workbook with seperate tabs and use a formula to look at a control tab to find any matches. I think it’s pretty much the same thing as your suggestion, just using vba and not regex.

    I thank you for your efforts

  • how to move cursor to begining of next line

    Locked
    2
    0 Votes
    2 Posts
    2k Views
    Scott SumnerS

    @Allan-Biggs

    Try pressing Alt+Home in your macro where you are pressing Home.

  • Silent Install in specific language

    Locked
    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Can Regex paste values into another file?

    Locked
    11
    0 Votes
    11 Posts
    4k Views
    Scott SumnerS

    @C-Ananda-Rao

    Well, when I asked for data, I guess I should have asked for an explanation of that data to accompany it… I suppose I assumed that the phone number was the last part of every line where digits were present. Anyway, hopefully @guy038’s response provides the help you needed.

  • Can't type "{" or "["

    Locked
    1
    0 Votes
    1 Posts
    814 Views
    No one has replied
  • De-Deuplicate chunks of text? (screenshot)

    Locked
    2
    0 Votes
    2 Posts
    704 Views
    Terry RT

    Well @John-Drachenberg I’d try and grab the records in the group of 5 lines from the date added to the url line, combining them all into 1 line (so replacing CR/LF) with some other delimiter. I’d then create a "key at the start of the line, possibly the main part of the url, excluding any /folder names. Sort all the lines so that it would easily match up possible duplicate urls. To my mind a duplicate is any url where even if the /folder names/ portion was different would warrant further inspection.

    At this point either eyeball the duplicates, or another regex could mark possible duplicates for further inspection.

    Not sure if you actually want a regex to just remove duplicates in the original file, or would be happy just getting a list of possible duplicates which you could then check against the original and remove manually.

    Terry

  • cursor invisible

    Locked
    2
    0 Votes
    2 Posts
    7k Views
    Scott SumnerS

    @Alain-Torrens

    Settings (menu) -> Preferences… -> Editing (box on left) -> Caret Settings -> Width can get you a much more visible caret/cursor…but not everything you’ve requested.

  • Find/Replace Command

    Locked
    2
    0 Votes
    2 Posts
    805 Views
    Scott SumnerS

    @Rasmus-van-moortel

    can someone please help me?

    Nope, not without more detail than that…hint: show some before and (desired) after data.

  • String not found ?

    Locked
    3
    0 Votes
    3 Posts
    883 Views
    Scott SumnerS

    @Terry-R said:

    Note that I have used the “” character before some,

    I think this is supposed to read:

    Note that I have used the “\” character before some,

  • Alt-S crashes 7.5.8 going into Compare window

    Locked
    5
    0 Votes
    5 Posts
    1k Views
    Hans SchulzeH

    https://github.com/pnedev/compare-plugin/releases

    Thanks for the heads up. I hadn’t thought of that.

    Maybe a “Recent News” thread? :)

  • Regex replace $1 (\1) not working after update

    5
    1 Votes
    5 Posts
    3k Views
    emdashbuckE

    Seems to be working now. Honestly can’t recall if I took an update in the last fifteen days. Thanks for the response!

  • Find and replace subset of string

    Locked
    4
    1 Votes
    4 Posts
    969 Views
    gerdb42G

    Ok, I see you found it by yourself. Note that \d is equivalent to [0-9]. But you need to escape the "." to "\." or else it will match any character e.g. “0n234” would also match.

  • Leading Zeros

    Locked
    11
    0 Votes
    11 Posts
    13k Views
    mkupperM

    @Jose-Emilio-Osorio said:

    @Scott-Sumner Use the mouse is good. But, I have more than 85000 lines in a file and it´s hard to drag the line to the last line. Any method to do this ?. Thanks for your help.

    If it’s a one-shot deal then use two search/replaces in regular expression mode (Ctrl-G in the search/replace box)

    Search for: ^
    Replace with: 00000000
    If you have leading spaces then use search for: ^ *

    That’ll put eight zeroes at the front of all lines

    The second search/replace is:
    Search for: ^[0]+([0-9]{8})$
    Replace with: \1

    That skips over excess leading zeroes, saves the last eight digits, and the replace part is the saved value.

    Now do one more pass which is to search for ^0{8}
    This searches for lines that start with eight zeroes.

    If you find any then either

    There were blank lines in the file and we now have 00000000 there. That may or may not be desirable One of the lines had a number with 9 or more digits and will now have something like 00000000123456789 One of the lines had something other than a number and now has 00000000~whatever was on the line~

    If you need to do this a lot then use sed. Google for GNU sed. It’s free. In sed the search/replaces would look like this

    sed -r -e "s/^/00000000/" -e "s/^0+([0-9]{8})$/\1/" input-file.txt >output-file.txt

    Then to check for errors

    sed -r -n -e "/^0{8}/ { = ; p }" output-file.txt

    This scans and for every line found that starts with eight zeroes it outputs the line number and then the offending line.

  • Find and Replace

    Locked
    17
    0 Votes
    17 Posts
    6k Views
    Jeremy HJ

    Ok, good to know! Thanks again guys for all the help!

  • How to copy-translate-paste certain lines?

    13
    0 Votes
    13 Posts
    3k Views
    Gregg MorrisG

    Yes, this works really well. I need to replace many large blocks of text of variable size in a large xml file. This solution works well for me.