Jump to content
Macro Express Forums

Copy text to Variables


Recommended Posts

I have what I think may be a fairly easy situation, but I am not sure how to do it...

 

I have text that I am copying into variables. I have a situation that will always exist. On the 6th line down into the text file or %T[6]% there is a consistent value, either Business or Residential, either way I want to copy that value into a Variable.

 

Then If the text or variable equals Residential I want to run Macro A.

 

If the text or Variable equals Business, I want to run Macro B.

 

I have the rest of the Macros built I just need to know how to do this part of it.

 

Thanks for any help.

 

Heather

Link to comment
Share on other sites

I usually have the variables %CR% (ASCII 13) and %LF% (ASCII 10) for carriage return and line feed which are the EoL (End of Line) characters. I would split your variable into an array variable %Temp%. You will need ot define the array with as many elements as you ever think you will have. No it’s simply a matter of “If %Temp[6]% is ‘Residential’”. Or “If contains” for a partial match. See attached

SampleSplit.mex

Link to comment
Share on other sites

Hey Cory,

 

I was hoping to find you. You have always been able to work out our weird situations or requests. This is what I am working with:

 

2ND WIND EXERCISE EQUIPMENT

W229N1416 WESTWOOD DR

WAUKESHA, WI 53186-1309

Phone: 262-524-1678

 

Listed Since: 2005

Business

 

County: WAUKESHA (55133)

 

Sorry it is 7th line or %T[6]%. Where this equals Residential I am going to continue in my original Macro. If this value equal Business I want to call and run a different Macro - "Select(Business)"

 

So:

If %T[6]% equals Business

Somehow run Macro Select(Business)

Else

Rest of Macro

End If

 

It is probably staring me in the face but...

 

Heather

Link to comment
Share on other sites

A line with nothing still counts as a line. Open your variables window (F5) and run my script and you can see what MEP is seeing. Or make a text box and put this in:

 

1: %T[1]%

2: %T[2]%

3: %T[3]%

4: %T[4]%

5: %T[5]%

6: %T[6]%

7: %T[7]%

8: %T[8]%

Link to comment
Share on other sites

Cory,

 

I am so sorry. I finally get it. Sometimes it takes a little while. Thank you for not giving up on me completely. Between this Topic and the other one, I think I have finally figured out what you have been trying to tell me for years about processing text....

 

Heather (and Bob)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...