Amerifax-Bob Posted April 25, 2011 Report Share Posted April 25, 2011 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 Quote Link to comment Share on other sites More sharing options...
Cory Posted April 25, 2011 Report Share Posted April 25, 2011 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 Quote Link to comment Share on other sites More sharing options...
Amerifax-Bob Posted April 25, 2011 Author Report Share Posted April 25, 2011 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 Quote Link to comment Share on other sites More sharing options...
Cory Posted April 25, 2011 Report Share Posted April 25, 2011 %T[7]% for the seventh line. Quote Link to comment Share on other sites More sharing options...
Amerifax-Bob Posted April 25, 2011 Author Report Share Posted April 25, 2011 No %T[6]% because of the blank line. It is the 6 line that contains text so we used 6. Heather Quote Link to comment Share on other sites More sharing options...
Cory Posted April 25, 2011 Report Share Posted April 25, 2011 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]% Quote Link to comment Share on other sites More sharing options...
Amerifax-Bob Posted April 28, 2011 Author Report Share Posted April 28, 2011 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) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.