Shyam Parimal Katti <spk...@nyu.edu> writes: > A semi-colon in the string value indicates the termination of a sql query. > So the expected out come is a conversion to a list of valid sql queries: > ['drop table sample_table;', 'create table sample_test (col1 int);', > 'select col1 from sample_test;']
I presume these strings are split from lines of input. If so, you would be better advised to use an SQL parsing library in the first place <URL:https://pypi.python.org/pypi/sqlparse/>, to get distinct SQL statements from a text stream. -- \ “We must find our way to a time when faith, without evidence, | `\ disgraces anyone who would claim it.” —Sam Harris, _The End of | _o__) Faith_, 2004 | Ben Finney -- https://mail.python.org/mailman/listinfo/python-list