1

I have the following sql statements (1K plus)

insert into sodeny values('ABC',123,'USER')
insert into sodeny values('XYZ',123,'USER')
insert into sodeny values('EFG',123,'USER')

I am trying to insert "GO" as a new line using Notepad++ but can't seem to get it...is it possible? I need the result to look like this

insert into sodeny values('ABC',123,'USER')
GO
insert into sodeny values('XYZ',123,'USER')
GO
insert into sodeny values('EFG',123,'USER')
GO

I am trying to create a script to be executed against a legacy DB.

Saif Khan
  • 18,402
  • 29
  • 102
  • 147
  • Do you mean you can't type it? (Is the file readonly?) Or do you mean you can't figure out the find/replace that'll do it automatically? – Chris Pfohl Feb 02 '11 at 19:38
  • 2
    This question appears to be off-topic because it is about how to use an application – Hogan Jan 03 '14 at 18:10

2 Answers2

6

simply repalce newlines with GO like this

search: \n replace: \nGO\n

yes as Joe commented you have to use extended mode to search for newlines (refer also to this)

Community
  • 1
  • 1
lweller
  • 11,077
  • 3
  • 34
  • 38
  • Make sure that the Search Mode is set to Extended – Joe Feb 02 '11 at 19:39
  • currently GO is not present...I am trying to add that as a new line....when replacing...I tried find \n replace with \n GO but couldn't get it...that's why I was asking if it was possible. – Saif Khan Feb 02 '11 at 19:41
  • Got it...it's the other way around find \n and replace with GO\n! – Saif Khan Feb 02 '11 at 19:46
3

What you actually want is:

Find what     : \n
Replace with  : \nGO\n

Note: two \n's, as prefix and suffix

At the bottom

Match whole word only (unticked)
Mach case             (unticked)
Wrap around           (unticked)

Search mode   : Extended (\n, \r.....)
RichardTheKiwi
  • 105,798
  • 26
  • 196
  • 262