I have a file containing lines like
insert into table_name (params1,params2,params3) values (43044,'x',23547003);
insert into table_name (params1,params2,params3) values (43024,'y',26557003);
.....
I want to remove the first column/value pair. i.e. this is the desired output.
insert into table_name (params2,params3) values ('x',23547003);
insert into table_name (params2,params3) values ('y',26557003);
How can I do this?
here is what I did till now
cat file_name | sed 's/params1,//g'
This removes the params1 but how do I remove the number after values?
Tl;dr
change from insert into table_name (params2,params3) values (43024,'y',26557003); to insert into table_name (params2,params3) values ('y',26557003);
You can use:
as per the following transcript:
The first
sedargument you already have. The second simply finds the first string made up of:"values (";Then it replaces that with
"values ("which effectively gets rid of the first argument of the values.