Jump to content
Macro Express Forums

Ascii File Process


m204prgmr

Recommended Posts

What is the best practice for running one ASCII file process within another?

I have a text file with just names and I want to use those names in a variable that is inserted into the second ASCII file process. The names text file looks like this:

INIT_ACTASS.txt

INIT_ACTCLIN1.txt

INIT_ACTFIN1.txt

INIT_ACTGHP1.txt

INIT_ACTMDL.txt

 

thanks

Link to comment
Share on other sites

Would something like this work?

// 'Variable to Receive First Field' is set to T1
ASCII File Begin Process: "names.txt" (ASCII Delimited Text )
 
 // Make sure that 'Variable to Receive First Field' is set to something like T10
 ASCII File Begin Process: "%T1%" (ASCII Delimited Text )
   
   // Put macro commands here
   
 ASCII File End Process
ASCII File End Process

or, since each line of your names file only contains one field, you could use the Text File Begin/End Process command in the outer loop:

// 'Variable to Receive First Field' is set to T1
Text File Begin Process: "names.txt"
 
 // Make sure that 'Variable to Receive First Field' is set to something like T10
 ASCII File Begin Process: "%T1%" (Comma Delimited Text )
   
   // Put macro commands here
   
 ASCII File End Process
Text File End Process

Be careful to make sure the variables used by the outside loop are not overwritten by the variables in the inside loop.

Link to comment
Share on other sites

Thanks Kevin,

I figured out the other night that I should be using the Text File Process for the outside loop. Here is what I currently have for a check of two text fields in the same line.

 

<REM2:><REM2:Process the text file><BTFBEG:020:000001:000000:C:\inits1.txt><ADFBEG:F11:001:000001:000000:C:\initsforchange\%T20%><IFVAR2:1:01:8:?&><AND><IFVAR2:1:01:8:TSI SAVE KEY><AND><IFVAR2:1:01:7:ORD CHAR><AND><IFVAR2:1:01:7:T KEY><TVAR2:30:01:bingo><ENDIF><ADFEND><REM2:><REM2:Move the odd text file><IFVAR2:1:30:7:bingo><DOFILE:07:YN:C:\initsforchange\%T20%>c:\Troubled procs KEY and ORD CHAR\%T20%><ENDIF><REM2:><REM2:Clear the Variables ><CLEARVAR1:T:ALL><BTFEND><REM2:>

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