How to fetch lines between two strings using shell script? For example I am having a file called file_text.txt as below.
MEDIUMINT
CREATE (
MAXVALUE
MEDIUMBLOB
MEDIUMINT
MEDIUMTEXT
MIDDLEINT );
MINUTE_SECOND
MINUTE_SECOND
CREATE (
MINUTE_MICROSECOND
MINUTE_SECOND
MOD );
MODIFIES
MEDIUMINT
CREATE (
NATURAL
NOT
NO_WRITE_TO_BINLOG
NULL );
NUMERIC
ON
OPTIMIZE
I want to grep all lines between CREATE and ; from the file. Including the CREATE and ;string.
Something like that:
will output:
Or in case you need
CREATE (
and);
just doIt will do smth like that:
Try this