[Gambas-user] traslate grep expresion to detect COMMENT in line sql
PICCORO McKAY Lenz
mckaygerhard at ...626...
Fri Jul 28 16:57:06 CEST 2017
i have a sql file that hava also lines like :
COMMENT " xxxx " , field f2 \n
in console with this grep/sed can sustituye multilines or single lines
sed -ne '/comment/{:;/\o47;\s*$/!{N;b};s/\n\s*/ /;p}' <file
but i need tho detect at the end of the COMMENT the ", secuence to
sustitute to "*/"
my target objetive it parse a text/line like this:
fiel1 TEXT COMMENT "coment fiel1" , field2 TEXT, fiel3 TEXT
fiel4 NUMBER(10,2), fiel5 TEXT COMMENT "pepepeep",
fiel6 TEXT
into this:
fiel1 TEXT /* coment fiel1*/ , field2 TEXT, fiel3 TEXT
fiel4 NUMBER(10,2), fiel5 TEXT /*pepepeep*/,
fiel6 TEXT
please help, its fine with REPLACE() but not always the secuence ' ", '
will be in same order/sapces combination, maybe could be ' " , ' or
with new line
Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com
More information about the User
mailing list