Jump to content
Macro Express Forums

ASCII files


Recommended Posts

I have tab delimeted files i need to run against my other software.

 

Po box,123,utah

Lexing,568,ohio

Pixar,245,new york

 

I need to say if T3=Utah then open software if T3=ohio then open notepad else close

 

I can make macro run 1st row (utah) but how do i tell it to go next row to see ohio and new york? My macro just repeat the same row over and over again which is utah.

 

Please help

 

Link to comment
Share on other sites

Using ASCII File Process it should give you a different value each time. Post a clip of your code and I can probably figure out what's going wrong for you.Or better yet export that macro to an MEX file and post it as an attachment.

 

BTW you should try to use named variables instead of the old ME3 style vars.

 

In your example I assume you mean %T[3]% when you write "T3".

Link to comment
Share on other sites

@Mindy79: This is the Macro Express Pro discussion forum. There is a separate forum area for discussions about Macro Express 3. The example that follows is for Macro Express Pro but the same technique applies to Macro Express 3.

 

You need to surround the macro commands that you want repeated with an ASCII File Begin Process followed by an ASCII File End Process command. Like this:

ASCII File Begin Process: "c:\test.csv" (Comma Delimited Text (.csv))
 If Variable %OneRecord[3]% Equals "Utah"
Activate or Launch: Window "Notepad", Program "Notepad.exe", Parameters ""
 End If
ASCII File End Process

 

The code within the Begin/End Process command will repeat once for each line in your file. With each loop, the content of the variables will change.

 

There is an example of how this works in the sample macros file. Look for samples.mex in the folder where the Macro Express or Macro Express Pro program files are installed. Or, you may download it from the Sample Macros page. Make sure to download the appropriate samples.mex file for Macro Express or Macro Express Pro.

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...