prompt engineering

write a python program to do the following

1 - read in customer.sql file as input
2 - parse ansi sql insert statements
3 - text columns should start and end with double quotes
  - remove N from start of unicode strings
4 - within a text column, replace commas with semicolons, 
    single and double quotes with the empty string

5 - Here is the list of columns.  Each output line needs all column values.  
    The first line should be a header with the brackets removed with all columns in csv format.

    [CustomerId]
    [FirstName]
    [LastName]
    [Company]
    [Address]
    [City]
    [State]
    [Country]
    [PostalCode]
    [Phone]
    [Fax]
    [Email]
    [SupportRepId]

6 - Some statements might have missing columns. 
    Make sure output has empty string for that column value.

7 - sample insert 1

Input 1:

INSERT INTO [dbo].[Customer] 
(
    [CustomerId], [FirstName], [LastName], [Company], [Address], [City], [State], [Country], [PostalCode], [Phone], [Fax], [Email], [SupportRepId]
) 
VALUES (19, N'Tim', N'Goyer', N'Apple Inc.', N'1 Infinite Loop', N'Cupertino', N'CA', N'USA', N'95014', N'+1 (408) 996-1010', N'+1 (408) 996-1011', N'tgoyer@apple.com', 3);

Output 1:

19,"Tim","Goyer","Apple Inc.","1 Infinite Loop","Cupertino","CA","USA","95014","+1 (408) 996-1010","+1 (408) 996-1011","tgoyer@apple.com",3


8 - sample insert 2

Input 2:

INSERT INTO [dbo].[Customer] 
(
    [CustomerId], [FirstName], [LastName], [Company], [Address], [City], [Country], [PostalCode], [Phone], [Fax], [Email], [SupportRepId]
) 
VALUES (5, N'František', N'Wichterlová', N'JetBrains s.r.o.', N'Klanova 9/506', N'Prague', N'Czech Republic', N'14700', N'+420 2 4172 5555', N'+420 2 4172 5555', N'frantisekw@jetbrains.com', 4);

Output 2:

5,"František","Wichterlová","JetBrains s.r.o.","Klanova 9/506","Prague","Czech Republic","14700","+420 2 4172 5555","+420 2 4172 5555","frantisekw@jetbrains.com", 4


9 - sample insert 3

Input 3:

INSERT INTO [dbo].[Customer] 
(
    [CustomerId], [FirstName], [LastName], [Address], [City], [State], [Country], [PostalCode], [Phone], [Fax], [Email], [SupportRepId]
) 
VALUES (18, N'Michelle', N'Brooks', N'627 Broadway', N'New York', N'NY', N'USA', N'10012-2612', N'+1 (212) 221-3546', N'+1 (212) 221-4679', N'michelleb@aol.com', 3);

Output 3:

18,"Michelle","Brooks","627 Broadway","New York","NY","USA","10012-2612","+1 (212) 221-3546","+1 (212) 221-4679","michelleb@aol.com",3


10 - sample insert 4

Input 4:

INSERT INTO [dbo].[Customer] 
(
    [CustomerId], [FirstName], [LastName], [Address], [City], [State], [Country], [PostalCode], [Phone], [Email], [SupportRepId]
) 
VALUES (20, N'Dan', N'Miller', N'541 Del Medio Avenue', N'Mountain View', N'CA', N'USA', N'94040-111', N'+1 (650) 644-3358', N'dmiller@comcast.com', 4);

Output 4:

20,"Dan","Miller","541 Del Medio Avenue","Mountain View","CA","USA","94040-111","+1 (650) 644-3358","dmiller@comcast.com",4


11 - sample insert 5

Input 5:

INSERT INTO [dbo].[Customer] 
(
    [CustomerId], [FirstName], [LastName], [Address], [City], [State], [Country], [Phone], [Email], [SupportRepId]
) 
VALUES (46, N'Hugh', N'O''Reilly', N'3 Chatham Street', N'Dublin', N'Dublin', N'Ireland', N'+353 01 6792424', N'hughoreilly@apple.ie', 3);

Output 5:

46,"Hugh","O'Reilly","3 Chatham Street","Dublin","Dublin","Ireland","+353 01 6792424","hughoreilly@apple.ie",3


12 - sample insert 6

Input 6:

INSERT INTO [dbo].[Customer] 
(
    [CustomerId], [FirstName], [LastName], [Address], [City], [Country], [PostalCode], [Phone], [Email], [SupportRepId]
) 
VALUES (9, N'Kara', N'Nielsen', N'Sønder Boulevard 51', N'Copenhagen', N'Denmark', N'1720', N'+453 3331 9991', N'kara.nielsen@jubii.dk', 4);

Output 6:

9,"Kara","Nielsen","Sønder Boulevard 51","Copenhagen","Denmark","1720","+453 3331 9991","kara.nielsen@jubii.dk",4


13 - sample insert 7

Input 7:

INSERT INTO [dbo].[Customer] 
(
    [CustomerId], [FirstName], [LastName], [Address], [City], [Country], [PostalCode], [Phone], [Email], [SupportRepId]
) 
VALUES (2, N'Leonie', N'Köhler', N'Theodor-Heuss-Straße 34', N'Stuttgart', N'Germany', N'70174', N'+49 0711 2842222', N'leonekohler@surfeu.de', 5);

Output 7:

2,"Leonie","Köhler","Theodor-Heuss-Straße 34","Stuttgart","Germany","70174","+49 0711 2842222","leonekohler@surfeu.de",5


14 - sample insert 8

Input 8:

INSERT INTO [dbo].[Customer] 
(
    [CustomerId], [FirstName], [LastName], [Address], [City], [Country], [PostalCode], [Email], [SupportRepId]
) 
VALUES (45, N'Ladislav', N'Kovács', N'Erzsébet krt. 58.', N'Budapest', N'Hungary', N'H-1073', N'ladislav_kovacs@apple.hu', 3);

Output 8:

45,"Ladislav","Kovács","Erzsébet krt. 58.","Budapest","Hungary","H-1073","ladislav_kovacs@apple.hu",3


15 - sample insert 9

Input 9:

INSERT INTO [dbo].[Customer] 
(
    [CustomerId], [FirstName], [LastName], [Address], [City], [Country], [Phone], [Email], [SupportRepId]
) 
VALUES (57, N'Luis', N'Rojas', N'Calle Lira, 198', N'Santiago', N'Chile', N'+56 (0)2 635 4444', N'luisrojas@yahoo.cl', 5);

Output 9:

57,"Luis","Rojas","Calle Lira, 198","Santiago","Chile","+56 (0)2 635 4444","luisrojas@yahoo.cl",5

16 - write a csv file named customer.csv as output