I'm trying to convert a MSSQL .sql file to MYSQL syntax file. I have managed to change some of the syntax using basic find/replace, but I also need to change the ordering of words in the line. Basically the statements are like this :
ALTER TABLE ADD INDEX index_name ON table_name(column_name)
and I want to correct the statements to this format(MYSQL syntax) :
ALTER TABLE table_name ADD INDEX index_name(column_name)
There are like 70 statements of this sort in the file.Basically, table_name has to be shifted from between ON and (, and put in between TABLE and ADD. Is it possible to do this using sed/awk/grep?