Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Replacing particular occurrence of a character

pcatterson
11 - Bolide

I want to identify and replace the third occurrence of the "T" character in each data row

 

AGCTTAGGCGAGTGCGAGTGCGATA

AGCTAGGCCGTAAAGCGAGGAGCCC

CTAGCATGCATGGGACCTAGGACCA

TAGAGATCGACGATTTACGAGGTTC

 

to

 

AGCTTAGGCGAGUGCGAGTGCGATA    replaces it at character 12 (base 0)

AGCTAGGCCGTAAAGCGAGGAGCCC    only 2 occurrences, replaces nothing

CTAGCATGCAUGGGACCTAGGACCA    replaces it at character 10

TAGAGATCGACGAUTTACGAGGTTC    replaces it at character 13

 

This is a simple case.  I'm looking for something like this that will work for any occurrence and any character or string more generally.  I expect it will require REGEX, but I'm not yet proficient with it.

12 REPLIES 12
pcatterson
11 - Bolide

That's exactly what I need!

JohnJPS
15 - Aurora

Glad we finally found a RegEx for it!  I also did a workflow that allows variable Find String, Replacement String, and Occurance number; (attached).

Capture.PNG

 

I think I like the RegEx more. LOL. 

Philip
12 - Quasar

Ha! I couldn't figure out the double parentheses part. Nice solution, jdunkerley!

 

To put that Inspire training into practice, I created a macro tool for you. You can specify the character you want to change, the character to replace it with, and the occurance location.

Labels