Search code examples
sqlregexnotepad++textpad

How to increase/replace all numbers in a script


I have a pretty large SQL script that has duplicate identities on the database the inserts are taking place on.

If I could increment all ints within the script by say 20 this should get round the issue. I was trying to suss out how to do this in Notepad++ and Textpad but failed miserably.

Was hoping someone may have some suggestions on how I could do this.


Solution

  • It's hard to understand exactly what you are looking for. You could add a zero to the end of every integer with ease. Post an example and I might be able to help more. Notepad++ tricks are one of my favorites.

    Enable Regex Searching in Notepad++. 
    Search for   :([0-9]*[0-9])
    Replace with :\10
    ( \1 is the value that was found )