I would like to update an existing master file with fex. I want to browse app path directory , open every master file, and write on each line of each master a news TITLE tag. It's for Oracle master files.
You can get the app directories and their files using APP QUERY and friends. That also allows filtering on certain extensions. Searching these forums should turn up some examples.
Next, you can go through each file using -REPEAT and -READ to read each line into an amper-variable. There should be enough examples of that as well.
Finally, you alter the contents of that variable if it contains FIELDNAME and not TITLE.
The difficult bits are determining which master files qualify (ie. they need an equaly named access file that references the appropriate CONNECTION) and determining what the contents of the added TITLE field should be.
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :
August 08, 2017, 10:27 AM
Thanks for your answer Wep5622
Ok for -READ but how can i update overwrite file ? with MODIFY command ?
I wrote a application that does just what you are looking for. The customer was using SQL Server and wanted the TITLE and DESCRIPTION to be the real field name from SQL Server but you can fix that part of the code to be whatever you want. I am going to to e-mail you the application.
Thank you for using Focal Point!
Chuck Wolff - Focal Point Moderator WebFOCUS 7x and 8x, Windows, Linux All output Formats
August 08, 2017, 10:50 AM
For something like this I'd recommend using APP COPYF to copy your MFDs to a temp folder. You could then use -READ and -WRITE in a loop to overwrite your original MFD.
August 08, 2017, 10:53 AM
Oh great chuck wolff, e-mail me the application . I w'ill test it