Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Need to work out for Regular Expression in WebFOCUS.
Go
New
Search
Notify
Tools
Reply
  
[CLOSED] Need to work out for Regular Expression in WebFOCUS.
 Login/Join
 
Member
posted
Hi All,

When I am reading A column from Relational Database in Table, It has some data with html tags. While reading A column through master file. I want to remove all html tags in A column and then need to pull the data into EXL2K.

Anyone, Can you help me out on this.

Thanks,
Veeramani K

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8
Windows, All Outputs
 
Posts: 27 | Registered: December 14, 2017Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Take a look at the character functions like REPLACE. https://webfocusinfocenter.inf...r/source/replace.htm


WebFOCUS 8206, Unix, Windows
 
Posts: 1707 | Location: New York City | Registered: December 30, 2015Reply With QuoteReport This Post
Member
posted Hide Post
Hi HabakNYC,

Thanks for your reply. I want to remove html tag with generic code.

For Example,
"LT/spanGT" - I can able to replace the exact value with space.

But, "LTspan style="font-family: Arial, sans-serif; font-size: 10pt;"GT" these kind of html tags are not generic.. so we need to apply some expression to remove multiple html tags from same paragraph.


WebFOCUS 8
Windows, All Outputs
 
Posts: 27 | Registered: December 14, 2017Reply With QuoteReport This Post
Virtuoso
posted Hide Post
You can combine REPLACE with IF-THEN-ELSE or DECODE. Look up Expressions in the Doc. https://webfocusinfocenter.inf.../source/ExpRef16.htm

https://webfocusinfocenter.inf...er/source/decode.htm


WebFOCUS 8206, Unix, Windows
 
Posts: 1707 | Location: New York City | Registered: December 30, 2015Reply With QuoteReport This Post
Expert
posted Hide Post
Look at the TOKEN function as that should allow you to identify the start and end of non HTML parts of the string.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.06 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5616 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
Expert
posted Hide Post
A slightly twisted way to do this would be to hold the data in a hold file (format alpha) then run something like SED on the hold file to remove the tags.

Note: if its windows, you will need to install GNU core utilities for windows.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.06OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Know The Code

 
Posts: 6131 | Location: 33.8688° S, 151.2093° E | Registered: October 31, 2006Reply With QuoteReport This Post
Guru
posted Hide Post
Hi, I have seen an example of this. On the table a virtual field could be built that strips out the html tags and then you could report against that.

Fernando


Prod WF 8.1.04, QA WF 8.2.03, Dev WF 8.2.03
 
Posts: 264 | Registered: October 10, 2006Reply With QuoteReport This Post
Member
posted Hide Post
Dear All,

For Example, As mentioned below DESCRIPTION_DATA values need to remove all html tags. When I ran the below code, Data output is getting generated in EXL2K. But, Description_Data column, It's applied html styling and data is splitting into multiple lines in EXL2Kreport.

Requirement: I want to remove all different kind of html tags in virtual field. And then wanna to display a record into single line with excel report output.

please help me out on this.



My Code:
DEFINE FILE CAR
DESCRIPTION_DATA/A2000 = '<p><span style="font-family: Arial, sans-serif; font-size: 10pt;">AGSouth is a member-owned grocer warehouse and also a member of Retailer Owned Food Distributors & Associates (ROFDA).</p><p><br></p><p>The team supports the new account boarding for this group. </p>';
END
TABLE FILE CAR
PRINT COUNTRY CAR MODEL  DESCRIPTION_DATA
WHERE RECORDLIMIT EQ 1;
ON TABLE HOLD FORMAT ALPHA

END
-RUN
TABLE FILE HOLD
PRINT *
ON TABLE PCHOLD FORMAT EXL2K
END
-RUN
-EXIT
  


WebFOCUS 8
Windows, All Outputs
 
Posts: 27 | Registered: December 14, 2017Reply With QuoteReport This Post
Expert
posted Hide Post
quote:
Look at the TOKEN function as that should allow you to identify the start and end of non HTML parts of the string.


T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.06 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5616 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
Expert
posted Hide Post
… or use nested REPLACE functions.

Also, stating "WebFOCUS 8" in your signature doesn't help anyone in replying as some functions are not available in early versions of 8 whereas they are in later versions. So be specific in your signature.

One final point, have you tried any of the suggestions here, searched the forum for the key words such as REPLACE, TOKEN etc.? You should at least look into some of the suggestions rather than post an example which shows no attempt to try out some of the suggestions made.

It's easy to provide a solution for you but ultimately that doesn't help you to learn. By pointing you to specific key words, you should be able to make some headway and thereby learn something in the process.


T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.06 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5616 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [CLOSED] Need to work out for Regular Expression in WebFOCUS.

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.