prompt engineering

write a python program to do the following

1 - read in invoice.sql file as input
2 - parse ansi sql insert statements
    ignore blank lines
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.
    [InvoiceId]
    [CustomerId]
    [InvoiceDate]
    [BillingAddress]
    [BillingCity]
    [BillingState]
    [BillingCountry]
    [BillingPostalCode]
    [Total] 

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].[Invoice] 
(
    [InvoiceId], [CustomerId], [InvoiceDate], [BillingAddress], [BillingCity], [BillingCountry], [BillingPostalCode], [Total]
) 
VALUES 
(1, 2, '2009/1/1', N'Theodor-Heuss-Straße 34', N'Stuttgart', N'Germany', N'70174', 1.98);

Output 2:

1,2,"2009/1/1","Theodor-Heuss-Straße 34","Stuttgart","Germany","70174",1.98

8 - sample insert 2

Input 2:

INSERT INTO [dbo].[Invoice] 
(
    [InvoiceId], [CustomerId], [InvoiceDate], [BillingAddress], [BillingCity], [BillingCountry], [Total]
) 
VALUES (125, 34, '2010/6/30', N'Rua da Assunção 53', N'Lisbon', N'Portugal', 0.99);

Output 2:

125,34,"2010/6/30","Rua da Assunção 53","Lisbon","Portugal", 0.99


9 - sample insert 3

Input 3:

INSERT INTO [dbo].[Invoice] 
(
    [InvoiceId], [CustomerId], [InvoiceDate], [BillingAddress], [BillingCity], [BillingState], [BillingCountry], [BillingPostalCode], [Total]
) 
VALUES (102, 15, '2010/3/16', N'700 W Pender Street', N'Vancouver', N'BC', N'Canada', N'V6C 1G8', 9.91);


Output 3:

102,15,"2010/3/16","700 W Pender Street","Vancouver","BC","Canada","V6C 1G8",9.91


10 - sample insert 4

Input 4:

INSERT INTO [dbo].[Invoice] 
(
    [InvoiceId], [CustomerId], [InvoiceDate], [BillingAddress], [BillingCity], [BillingState], [BillingCountry], [BillingPostalCode], [Total]
) 
VALUES (102, 15, '2010/3/16', N'700 W Pender Street', N'Vancouver', N'BC', N'Canada', N'V6C 1G8', 9.91);


Output 4:

102,15,"2010/3/16","700 W Pender Street","Vancouver","BC","Canada","V6C 1G8",9.91

11 - write a csv file named invoice.csv as output