Removing anything between two double quotes

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, MudGuard

Post Reply
kwhaley
Posts: 2
Joined: Thu Feb 10, 2011 5:45 pm

Removing anything between two double quotes

Post by kwhaley »

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.
ben_josephs
Posts: 2464
Joined: Sun Mar 02, 2003 9:22 pm

Post by ben_josephs »

This has been discussed here many times before. Unfortunately, there is no way using TextPad's regex recogniser to match an arbitrary number of newlines. So your problem cannot be solved in TextPad with a single regular expression replacement.

Other tools, such as WidlEdit (http://www.textpad.com/products/wildedit/) use more modern and powerful regex engines that do not suffer from this restriction.
kwhaley
Posts: 2
Joined: Thu Feb 10, 2011 5:45 pm

Post by kwhaley »

Thanks Ben.
Post Reply