Search for a word (or words) within a string and add substring before and after
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi everyone,
I need some help! I am trying to add a substring before and after certain words I'm searching for. The formatting of the original text should remain the same. It however need to identify all the different format variations of the word and add the substring to all of them.
Example:
String - "Thank you Alteryx for an amazing platform for Data Analysis. I am new to the data world, but am enjoying to learning experience. The problem with DATA is that it's in everything, it's dynamic, it's unstructured and difficult for an untrained process to understand. However, the better you structure the process, the better it will understand the data."
Search word - "data"
Result - "Thank you Alteryx for an amazing platform for {_Data_} Analysis. I am new to the {_data_} world, but I am enjoying to learning experience. The problem with {_DATA_} is that it's in everything, it's dynamic, it's unstructured and difficult for an untrained process to understand. However, the better you structure the process, the better it will understand the {_data_}."
(Excuse the example, I had to think of something with a couple of words repeating and voilà )
Thanks for the help
An Alteryx Enthusiast
Solved! Go to Solution.
- Labels:
- Datasets
- Dynamic Processing
- Join
- Regex
- Text Mining
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @jgv27
I believe the best way to approach this could be to use the find and replace. With the find and replace we can input a reference table with the changes to be made and make it case sensitive. There are logics you can also do with the formula tool, but i believe they would be more time consuming.
Pedro.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Hi @jgv27 ,
I've attached a solution using the formula and text to column tool in attempt to make it a bit more dynamic. Certainly a bit more effort than just manually entering the replace values
Regards,
Anthony
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Notify Moderator
Thank you @pedrodrfaria and @AntDavis42 for your responses.
At the end it was just as easy as using the simple find and replace tool.
