Page 1 of 1

Can we replace text with position

Posted: Thu Sep 10, 2015 10:13 am
by samjith
I need to replace some text,
1. I don't know what is that text.
2. I know the position of the text,
3. I don't want to change any text other than that text

eg: This is an sample text splitted with tab 10 100 10 tab

seperated line with tab (not space)

I need to replace word with position 6 ("tab") with "my name"
But i don't want to change the second word "tab"

Re: Can we replace text with position

Posted: Thu Sep 10, 2015 10:14 am
by samjith
Eg: This is____an_______sample________text_______splitted with_______tab______10______100_______10_______tab

Re: Can we replace text with position

Posted: Thu Sep 10, 2015 12:20 pm
by Klaus
Namaste samjith,

the magic word is "itemdelimiter" :D
Then it is a simple as this:
...
set itemdel to TAB
put "your name" into item 6 of tText
...


Best

Klaus

Re: Can we replace text with position

Posted: Thu Sep 10, 2015 12:40 pm
by samjith
Namaste Kiaus,

Thanks for this code,
put "your name" into item 6 of tText, that is what i want :D

Re: Can we replace text with position

Posted: Thu Sep 10, 2015 1:18 pm
by Klaus
samjith wrote:put "your name" into item 6 of tText, that is what i want :D
Yes, I know what is good for you! :D