Removing anything between two double quotes
Posted: Thu Feb 10, 2011 7:06 pm
Did a search and couldn't find this particular problem.
I have data exported from a database in csv format. Looks something like this:
begin sample
"AIGFP-FTC-IDR0000001","||REVIEWED|
||26(a) Disclosures|
||Privilege|
|Production|1-Produced in Foppingadreef Investments II AND 26A|
|Production|1-all|
|CROSS BORDER TRANSACTIONS|
|CROSS BORDER TRANSACTIONS|Foppingadreef Investments II|
|CROSS BORDER TRANSACTIONS|Foppingadreef Investments II|Produced|
|CROSS BORDER TRANSACTIONS|Foppingadreef Investments II|Produced|AIGFP-FTC-IDR Collection|
|CROSS BORDER TRANSACTIONS|Foppingadreef Investments II|Produced|AIGFP-FTC-IDR Collection|Closing Documents|
|CROSS BORDER TRANSACTIONS|Foppingadreef Investments II|FOIA Documents|
|CROSS BORDER TRANSACTIONS|Foppingadreef Investments II|FOIA Documents|Box 2|
|tech|20090929 production|
|tech|check1|
|tech|20091203 copy orig begin num|
|tech|check2|
|WITNESS FILES|Ruffa, Gregory|
|WITNESS FILES|Ruffa, Gregory|Docs Produced by Government|
|WITNESS FILES|Ruffa, Gregory|Docs Produced by Third Party|
|WITNESS FILES|Ruffa, Gregory|Privileged Doc Search|
|HOT DOCS|
|SUTHERLAND REVIEW FOLDERS|Redacted Production Docs|
|SUTHERLAND REVIEW FOLDERS|Redacted Production Docs|Privileged|
"
"AIGFP-FTC-IDR0000003","||REVIEWED|
||26(a) Disclosures|
|Production|1-Produced in Foppingadreef Investments II AND 26A|
|Production|1-all|
|CROSS BORDER TRANSACTIONS|
|CROSS BORDER TRANSACTIONS|Foppingadreef Investments II|
|CROSS BORDER TRANSACTIONS|Foppingadreef Investments II|Produced|
|CROSS BORDER TRANSACTIONS|Foppingadreef Investments II|Produced|AIGFP-FTC-IDR Collection|
|CROSS BORDER TRANSACTIONS|Foppingadreef Investments II|FOIA Documents|
|CROSS BORDER TRANSACTIONS|Foppingadreef Investments II|FOIA Documents|Box 2|
|tech|20090929 production|
|tech|20091203 copy orig begin num|
"
end sample
Basically, I'm trying to remove everything in the second field (the second set of double quotes) so it will look something like this:
"AIGFP-FTC-IDR0000001",""
"AIGFP-FTC-IDR0000003",""
I can remove individual lines but over multiple lines, it stymies me. I rather do it in one regex replacement than remove each line. I'm trying to remove data from the second field so I can match it back into the database.
I have data exported from a database in csv format. Looks something like this:
begin sample
"AIGFP-FTC-IDR0000001","||REVIEWED|
||26(a) Disclosures|
||Privilege|
|Production|1-Produced in Foppingadreef Investments II AND 26A|
|Production|1-all|
|CROSS BORDER TRANSACTIONS|
|CROSS BORDER TRANSACTIONS|Foppingadreef Investments II|
|CROSS BORDER TRANSACTIONS|Foppingadreef Investments II|Produced|
|CROSS BORDER TRANSACTIONS|Foppingadreef Investments II|Produced|AIGFP-FTC-IDR Collection|
|CROSS BORDER TRANSACTIONS|Foppingadreef Investments II|Produced|AIGFP-FTC-IDR Collection|Closing Documents|
|CROSS BORDER TRANSACTIONS|Foppingadreef Investments II|FOIA Documents|
|CROSS BORDER TRANSACTIONS|Foppingadreef Investments II|FOIA Documents|Box 2|
|tech|20090929 production|
|tech|check1|
|tech|20091203 copy orig begin num|
|tech|check2|
|WITNESS FILES|Ruffa, Gregory|
|WITNESS FILES|Ruffa, Gregory|Docs Produced by Government|
|WITNESS FILES|Ruffa, Gregory|Docs Produced by Third Party|
|WITNESS FILES|Ruffa, Gregory|Privileged Doc Search|
|HOT DOCS|
|SUTHERLAND REVIEW FOLDERS|Redacted Production Docs|
|SUTHERLAND REVIEW FOLDERS|Redacted Production Docs|Privileged|
"
"AIGFP-FTC-IDR0000003","||REVIEWED|
||26(a) Disclosures|
|Production|1-Produced in Foppingadreef Investments II AND 26A|
|Production|1-all|
|CROSS BORDER TRANSACTIONS|
|CROSS BORDER TRANSACTIONS|Foppingadreef Investments II|
|CROSS BORDER TRANSACTIONS|Foppingadreef Investments II|Produced|
|CROSS BORDER TRANSACTIONS|Foppingadreef Investments II|Produced|AIGFP-FTC-IDR Collection|
|CROSS BORDER TRANSACTIONS|Foppingadreef Investments II|FOIA Documents|
|CROSS BORDER TRANSACTIONS|Foppingadreef Investments II|FOIA Documents|Box 2|
|tech|20090929 production|
|tech|20091203 copy orig begin num|
"
end sample
Basically, I'm trying to remove everything in the second field (the second set of double quotes) so it will look something like this:
"AIGFP-FTC-IDR0000001",""
"AIGFP-FTC-IDR0000003",""
I can remove individual lines but over multiple lines, it stymies me. I rather do it in one regex replacement than remove each line. I'm trying to remove data from the second field so I can match it back into the database.