I've a big query from SQL Server in notepad++ (1012 lines) and I want to pass this query to only one line. For example, I've this:
SELECT *
FROM tableA
WHERE Field_A = 1
And I want to pass to this:
SELECT * FROM tableA WHERE Field_A = 1
I'm trying with the following codeS:
(\h*\R)+
in the Find what: zone\x20
in the Replace with: zoneBut it's creating me some more new lines with a big space between the code.
How can I do this?
You have to remove the spaces just after the linebreak, use this regex (?:\h*\R\h*)+
(?:\h*\R\h*)+
A SINGLE SPACE
Explanation:
(?: : start non capture group
\h* : 0 or more horizontal spaces
\R : any kind of linebreak (ie. \r, \n, \r\n)
\h* : 0 or more horizontal spaces
)+ : end group, repeated 1 or more times
Replacement:
A single space
Given example like:
SELECT *
FROM tableA
WHERE Field_A = 1
Result for given example:
SELECT * FROM tableA WHERE Field_A = 1