By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,818 Members | 1,381 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,818 IT Pros & Developers. It's quick & easy.

remove blocks from a text

P: 1
Hi everbody,
i want to remove text blocks which start with 'Description=string' and finish with 'CampaignServer/RightPointCampaignServer/MdapEngine/Services/CC-Corporate-Service]' and include 'explorer'. i want to remove this blocks from my text.

Thanks you...

my text:

Description=string:
SignificanceThreshold=dword:14
ServiceRelativeDirectory=string:GoldenMiner
StartSyncTime=dword:7FFFFFFF
TraceLevel=dword:0
[CampaignServer/RightPointCampaignServer/MdapEngine/Services/CC-Corporate-Service]
Description=string:
SignificanceThreshold=dword:14
ServiceRelativeDirectory=string:explorer
StartSyncTime=dword:7FFFFFFF
TraceLevel=dword:0
[CampaignServer/RightPointCampaignServer/MdapEngine/Services/CC-Corporate-Service]

Description=string:
SignificanceThreshold=dword:14
ServiceRelativeDirectory=string:Example
StartSyncTime=dword:7FFFFFFF
TraceLevel=dword:0
[CampaignServer/RightPointCampaignServer/MdapEngine/Services/CC-Corporate-Service]
Description=string:
SignificanceThreshold=dword:14
ServiceRelativeDirectory=string:explorer
StartSyncTime=dword:7FFFFFFF
TraceLevel=dword:0
[CampaignServer/RightPointCampaignServer/MdapEngine/Services/CC-Corporate-Service]

Description=string:
SignificanceThreshold=dword:14
ServiceRelativeDirectory=string:question
StartSyncTime=dword:7FFFFFFF
TraceLevel=dword:0
[CampaignServer/RightPointCampaignServer/MdapEngine/Services/CC-Corporate-Service]
Apr 22 '10 #1
Share this Question
Share on Google+
1 Reply


P: 43
Read the file one record at a time as you would normally do. When you reach a "Description=string:" record, append each record to a list until the next "Description=string:" record is found. if you want to retain the records in the list, copy them to a file or whatever, then empty the list, rinse and repeat.
Apr 22 '10 #2

Post your reply

Sign in to post your reply or Sign up for a free account.