Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Extract Multiple Hashtags from text

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Extract Multiple Hashtags from text
 Login/Join
 
Member
posted
I tried to figure this one out myself, but I was unsuccessful. Any suggestions would be appreciated.

I have a large text field (A500) and I need to extract each word that begins with a hashtag '#' into a separate column within an Excel document.

Example data text: A boy name #Jack ran up the #hill to fetch a pail of #water on #11/14/2016.

From the example I am hoping to extract #Jack, #hill, #water, and #11/14/2016 and then place them into an output where each hashtag is a separate field. In the example there will be four columns, but the text field can be random. Could be zero hashtags or could be up to 10.

This message has been edited. Last edited by: ChadSS,
 
Posts: 26 | Location: Jackson, MS | Registered: January 22, 2010Report This Post
Expert
posted Hide Post
Look at using GETTOK.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Virtuoso
posted Hide Post
GETTOK is the way to go:
  
-* File CHAD01.fex
DEFINE FILE CAR
STRING/A500='A boy name #Jack ran up the #hill to fetch a pail of #water on #11/14/2016';
MYSTRING/A502='#x' || STRING;
-REPEAT #HASH FOR &I FROM 1 TO 10;
-SET &J=&I + 1;
PHASH&I/A200=GETTOK(MYSTRING, 501, &J, '#', 200, 'A200');
THASH&I/A20=GETTOK(PHASH&I, 200, 1, ' ', 20, 'A20');
HASH&I/A21=IF THASH&I EQ ' ' THEN ' ' ELSE '#' || THASH&I;
-#HASH
END

TABLE FILE CAR
PRINT COUNTRY NOPRINT
-REPEAT #TAGS FOR &I FROM 1 TO 10;
HASH&I
-#TAGS
IF RECORDLIMIT EQ 1
END


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Virtuoso
posted Hide Post
Sweet... Smiler
 
Posts: 1903 | Location: San Antonio | Registered: February 28, 2005Report This Post
Member
posted Hide Post
Thanks Danny-SRL, worked like a charm.
 
Posts: 26 | Location: Jackson, MS | Registered: January 22, 2010Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] Extract Multiple Hashtags from text

Copyright © 1996-2020 Information Builders