Hi, I think this is also what is Tony is suggesting. We have used something along these lines:
Firstly, create a Master file that will always be in your path, that looks something like this:
FILENAME=UTILDA80,SUFFIX=FIX ,$
SEGNAME=UTILDAT1 ,SEGTYPE=S0
FIELDNAME=DATA,,A80,A80,$
For my example I will call it util_txt_80.mas
My process then is as follows:
1) I make a copy of the file that I will "edit" e.g. the ACX file
2) I read this file and write out the new ACX file with the required name, using DEFINEs to manipulate the line
3) I delete the copy made in step 1 (optional!)
-DEFAULT &1 = 'baseapp'
-DEFAULT &2 = 'file_in'
-DEFAULT &3 = 'MASTER'
-SET &BAK_FILE = &2 || '_bak' ;
APP COPYFILE &1 &2 &3 &1 &BAK_FILE &3
-RUN
-SET &FILE_EXT = DECODE &3('MASTER' '.mas'
- 'ACCESS' '.acx'
- 'FOCEXEC' '.fex'
- ELSE '.txt') ;
-SET &FILE_IN = &1 || '/' || &BAK_FILE || &FILE_EXT ;
-SET &FILE_OUT = &1 || '/' || &2 || &FILE_EXT ;
FI util_txt_80 DISK &FILE_IN
FI TTTXTOUT DISK &FILE_OUT
-RUN
DEFINE FILE util_txt_80
LINE_OUT/A80 = IF DATA CONTAINS 'CONNECTION=' THEN 'CONNECTION=somethingnew' ELSE
DATA ;
END
-RUN
TABLEF FILE util_txt_80
PRINT LINE_OUT
ON TABLE SET HOLDLIST PRINTONLY
ON TABLE SAVE AS TTTXTOUT
END
-RUN
Obviously this is a very simple example - all the "hard work" will need to be in the DEFINE.
To call this routine, you could then run it with the following command as an example:
EX UTIL_TXT_EDIT baseapp,car,ACCESS
Something along those lines.
WebFOCUS 8.2.06 mostly Windows Server