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, 2010
-* 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;
TABLE FILE CAR
PRINT COUNTRY NOPRINT
-REPEAT #TAGS FOR &I FROM 1 TO 10;
IF RECORDLIMIT EQ 1
Daniel In Focus since 1982 wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF
Posts: 1961 | Location: Tel Aviv, Israel | Registered: March 23, 2006