I am reading a file in groovy using this simple sample code
file.eachLine {line->
// do something with line
}
For example my file has some data like this
blah blah blah
This is some more lines
more lines
Insert into something
(x1,x2,x3)
(Select * from
some table
where
something = something)
on rowid = something;
So I want to read a snippet. If I see a line with rowid that also has a 'semicolon' at the end. then I want to read back till '(select'
So after reading this file I want to have a string that contains:
(Select * from
some table
where
something = something)
on rowid = something;
Is that possible? and how?