search and delete insert statement in file

Questions, tips and tricks and techniques for scripting in Servoy

search and delete insert statement in file

Postby rogel » Tue Sep 13, 2011 6:24 am

hi!

some may have already done this one.
i need to manipulate backup(sql file) to delete the insert statement where userid=user1

the SQL file contains...
Code: Select all
--
-- PostgreSQL database dump
--

SET statement_timeout = 0;
SET search_path = public, pg_catalog;

--
-- Data for Name: address; Type: TABLE DATA; Schema: public; Owner: postgres
--

INSERT INTO address (idaddress, street, city, userid) VALUES (1, '199 Essex Street', 'Epping', 'user1');
INSERT INTO address (idaddress, street, city, userid) VALUES (2, '200 Essex Street', 'Epping', 'user2');


thanks!
rogel
 
Posts: 264
Joined: Mon Jul 04, 2011 9:09 am

Return to Methods

Who is online

Users browsing this forum: No registered users and 7 guests