Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unwanted text in a record
Message
From
13/06/2011 02:41:08
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
To
10/06/2011 08:57:28
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01513961
Message ID:
01514203
Views:
55
>>>I am pulling a lot of text from web pages. With it comes quite a bit of code(ish) looking unwanted characters and snippets.
>>>
>>>Is there an efficient way to delete the unwanted text without removing all or part of the text I want along with it?
>>
>>What do you mean by unwanted text? To remove some text, you can use CHRTRAN function or for more complex patterns, RegEx.
>
>Below is an example of the unwanted text. (BTW Thank you for your replies and assistance)
>
>var adSynchId = "787423";
>
>if (typeof tq != "undefined") { if (typeof tq.urlFullQuery != "undefined"){ urlPath = tq.urlFullQuery; } } else { urlPath = "&url=/"; } document.getElementById("remnantIframe728").src = "http://abcnews.go.com/Adserver?CallDown&AdTypes=Banner-Remnant" + urlPath; #search form{_position:relative;_top:3px;}.window{*text-align:center;}#sectionnav, #shownav{text-align:left;}
>
> logoIE = false; if(typeof document.all!="undefined"){ if(typeof document.getElementById!="undefined"){ if(navigator.userAgent.toLowerCase().indexOf("msie 6")!=-1){ logoIE = true; }}} logoSrc = ''; logoImg = (logoIE)?'http://a.abcnews.com/images/site/vortex/spacer.gif' : 'http://a.abcnews.go.com/images/Site/default_mainlogo_sm.png' logoSrcFilter = (logoIE)?' style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=http://a.abcnews.go.com/images/Site/default_mainlogo_sm.png, sizingMethod=scale);" ' : ''; logoSrc += 'img id="abcnewslogo" src="'+logoImg+'" '; logoSrc += logoSrcFilter; logoSrc += ' alt="ABC News" width="158" height="70" border="0"'; document.write(logoSrc);

Such javascript would be between <:script and /script> tags, which you can detect by strextract(), and then excise from the string. Same goes for style tags (though those would rather be in the header).

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform