No announcement yet.

Ignore constant string

  • Filter
  • Time
  • Show
Clear All
new posts

  • Ignore constant string

    I have two files that contain SQL. They are nearly identical other than the fact that one has _TST appended to all of its table names. I would like to ignore any lines where the only difference is _TST. I tried replacements, but I couldn't replace _TST with nothing. Someone else requested this, but there example could be worked around by using a regular expression. I wasn't able to accomplish my goal that way, but regular expressions are not something I have much experience with.

    Is there a way to ignore a particular constant during a comparison?

  • #2
    You can do that by matching the entire table name instead of just the _TST part. So if the _TST file is on the left:

    Text to find: (\w+)_TST
    Replace with: $1
    [x] Regular expression

    If it's on the right you could find (\w+) and replace it with $1_TST
    Zoë P Scooter Software


    • #3
      That works like a charm. Thank you.