I am trying to format a database script and I need to remove the last " , " from the lines that are before ")," but I have not been successful ...
This is the input file
DROP TABLE IF EXISTS attribute_type;
CREATE TABLE attribute_type (
attribute_type_id int(11) NOT NULL,
name varchar(30) COLLATE es_CO.UTF-8 NOT NULL,
description text COLLATE es_CO.UTF-8,
is_set smallint(6) DEFAULT NULL, <-- Here is the last character I want to remove
),
DROP TABLE IF EXISTS attribute_type_options;
CREATE TABLE attribute_type_options (
attribute_type_options_id int(11) NOT NULL,
person_attribute_type_id int(11) DEFAULT NULL,
name varchar(60) COLLATE es_CO.UTF-8 NOT NULL,
default_value bit(1) DEFAULT NULL, <-- Here is the last character I want to remove
),
This should be the output
DROP TABLE IF EXISTS attribute_type;
CREATE TABLE attribute_type (
attribute_type_id int(11) NOT NULL,
name varchar(30) COLLATE es_CO.UTF-8 NOT NULL,
description text COLLATE es_CO.UTF-8,
is_set smallint(6) DEFAULT NULL
),
DROP TABLE IF EXISTS attribute_type_options;
CREATE TABLE attribute_type_options (
attribute_type_options_id int(11) NOT NULL,
person_attribute_type_id int(11) DEFAULT NULL,
name varchar(60) COLLATE es_CO.UTF-8 NOT NULL,
default_value bit(1) DEFAULT NULL
),
I tried this solution but it does the change in all lines , not just where I need
Thank you for your help !!!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…