Text manipulation

  • Thread starter Deleted member 8206
  • Start date
D

Deleted member 8206

Guest
T: empty
A:

Is it possible to Change this
Hi
Hello
How
Are
You

To
1.Hi
2.Hello
3.How
4.Are
5.You

Just we have to add numbers
I tried my best but failed😅
 

Endercraft

Moderator (& bug finder :D)
T: empty
A:

Is it possible to Change this
Hi
Hello
How
Are
You

To
1.Hi
2.Hello
3.How
4.Are
5.You

Just we have to add numbers
I tried my best but failed😅
What variable are you using ? If the words are stored in an array try this macro :
Nevermind when I tested it macrodroid freezed and didn't save my macro !
 

Dm114

Well-known member
T: empty
A:

Is it possible to Change this
Hi
Hello
How
Are
You

To
1.Hi
2.Hello
3.How
4.Are
5.You

Just we have to add numbers
I tried my best but failed😅
If these strings are stored in a single string variable, use Split to array option of Text manipulation. Then it'll be very easy to scroll the whole array from the 1st to the last index and add a chronological number to every item value
 

RSF

Well-known member
If these strings are stored in a single string variable, use Split to array option of Text manipulation. Then it'll be very easy to scroll the whole array from the 1st to the last index and add a chronological number to every item value
This post has an example of that. You'll want to change the \s+ option on the Split to Array action, to \n.
\s works for a string like "Hi Hello How Are You", whereas \n works for "Hi
Hellow
How
Are
You"
 

MacroDroidDev

Administrator
Staff member
Try this:

Actions ->
Text Manipulation: Source = input variable, string delimiter is \n and save to an array (called splitInput)
Set Variable (Integer): prefixNumber = {iterator_array_index} + 1
Set Variable: StrOutput = <blank>
Iterate Dictionary/Array (splitInput)
Set Variable: {strOutput}{prefixNumber}.{iterator_value}`n
End Loop
 
Top