Posts: 1,336
Threads: 61
Joined: Jul 2006
i am trying to get the text in of () just not having any luck
i ned to do 2 things
#1 get the text inside ex str a="(the text i want)"
#2 if str is this str a= " some text(more text)"--remove this(more text)-- so there is only first part
Posts: 473
Threads: 33
Joined: Aug 2007
I'm somewhat confused by the explanation but you should be able to do it with from?
Macro ( Macro33 )
str s="hello"
str ss.from(s)
out ss
No clue if this is what your wanting?
Taking on Quick Macros one day at a time
Posts: 1,336
Threads: 61
Joined: Jul 2006
ok some like this
str a="test text1 (test text2)"
in 1 case i want 2 get only text text2
in the other i only want 2 get text test 1
Posts: 473
Threads: 33
Joined: Aug 2007
Like this?
Macro ( Macro33 )
lpstr s="Test Text 1 (Test Text 2)"
str q.left(s 11);;Grabs Test Text 1
str w.get(s 13 11);;Grabs Test Text 2
out q
out w
Taking on Quick Macros one day at a time
Posts: 1,336
Threads: 61
Joined: Jul 2006
now those are just samples the text will be different each time and unknown
Posts: 473
Threads: 33
Joined: Aug 2007
So did that help or are you still looking for help? Where is the text coming from? Is there going to be one set of text in parentheses and one regular?
Taking on Quick Macros one day at a time
Posts: 1,336
Threads: 61
Joined: Jul 2006
now those are just samples the text will be different each time and unknown meaing the nuber of charcters could be different each time basically i'm getting the text off a window and don't know exactly what the text will be or how many characters are in it till the function is run.also the text may have other characters such as -,:;*or () before the (test text2) that help you out any? the example u gave works fine for the example i gave but the problem is the number of characters and the text will be different everytime
Posts: 473
Threads: 33
Joined: Aug 2007
So your saying that there is going to be a random amount of text before the () and there will be a random amount of text inside of the ()? Will there be () inside the string? or are you just using that to seperate the 2 parts?
Taking on Quick Macros one day at a time
Posts: 1,336
Threads: 61
Joined: Jul 2006
yes
radom amount of text here (radom amount of Text here)
text could be like
)*ihiry_rgfdg_rryte*
) (testing_1234)
Posts: 1,336
Threads: 61
Joined: Jul 2006
Gin i tried using other functions was asking for help making a regular expression to accomplish the task but having trouble. i tried using trim,rtrim, ltrim but that doesn't seem to work