I have a bunch of stored procedure scripts from sql server that I'd like to extract the custom coding section from. The area I'd like to grab is preceded by this:
/* **************************************************************************************************************************************************** */
/* * Begin Custom Code ******************************************************************************************************************************** */
/* **************************************************************************************************************************************************** */
and followed by this:
/* **************************************************************************************************************************************************** */
/* * End Custom Code ********************************************************************************************************************************** */
/* **************************************************************************************************************************************************** */
So the script would look like:
/* **************************************************************************************************************************************************** */
/* * Begin Custom Code ******************************************************************************************************************************** */
/* **************************************************************************************************************************************************** */
SELECT col1, col2
FROM [dbo].[table1]
ORDER BY col1
/* **************************************************************************************************************************************************** */
/* * End Custom Code ********************************************************************************************************************************** */
/* **************************************************************************************************************************************************** */
Is there a way to read the file and write the lines in between those markers to a separate file as one long string (no tabs or line breaks)?