Quantcast
Channel: Data Preparation & Blending discussions
Viewing all articles
Browse latest Browse all 4999

Replacing particular occurrence of a character

$
0
0

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.


Viewing all articles
Browse latest Browse all 4999

Latest Images

Trending Articles



Latest Images