Hi Team,
I have a content in the cell like AABCABCHDAKIJHUHYGTRLKJHTBAGRTLKJHYLFGHTPQWERPTHFM this. Now what I want has a output is, I want to add " " a blank space into this cell at the series of five characters. So after every 5th character I want to add the blank space.
The output should like AABCA BCHDA KIJHU HYGTR LKJHT BAGRT LKJHY LFGHT PQWER PTHFM
Can anyone please help on this to solve.
Solved! Go to Solution.
Hi @Gsiva3
Here is how you can do it.
workflow:
1. Using record id i am creating row id. This will be the key reference just in case you have multiple rows.
2. Using Regex tool tokenize mode i splitting 5 letters to each row.
3. Using Summarize with record id (key) on groupby i am conacting the rows with separator " " space to get the desired output. Just for reference i am creating input field by concating the rows with no separator.
Hope this helps 🙂
@Gsiva3
We can trust RegEx. 😁
Hi @Gsiva3
I got some time to try out regex approach. And here is it is approach 2 using regex_replace()
REGEX_Replace([Input], "(\w{5})(\w{5})", "$1 $2")
I am finding subsequent 5 letters using marked groups and then adding space inbetween "$1 $2"
Definitely approach 2 is recommended
Hope this helps 🙂
Manh posted nearly at the same time @Qiu with few seconds difference 😅 Close call
Hi @atcodedog05 & @Qiu
Got it! Thank you so ,much.
I just want to know one more thing. If I want to add "*" instead of Blank space, then how this can be done?
Hi @Gsiva3
REGEX_Replace([Input], "(\w{5})(\w{5})", "$1*$2")
Just replace " " with "*" in between $1 & $2.
Hope this helps 🙂
@atcodedog05 Thank you so much!!!
@Gsiva3
It looks like @atcodedog05 already provided your follow-up question and thank you for the accept mark.
User | Count |
---|---|
18 | |
14 | |
13 | |
9 | |
8 |