Converting old file pro processing tables

Bob Stockler bob at trebor.iglou.com
Wed Jul 26 12:01:48 PDT 2006


J. Ryan Kelley wrote (on Wed, Jul 26, 2006 at 12:35:38PM -0400):

| I'm doing some work with some processing tables that requires that I 
| have access to them in plain text format, which is fine for all of my 
| recently created processing tables.  However, it seems that processing 
| tables created in older versions of cabe stored the text of the 
| processing table in a non human readable format.  If I go into the 
| processing table in cabe and save it, the file is switched over to the 
| new plain text, easy to read and analyze format, which is great except I 
| have potentially hundreds of these processing tables and instead of 
| spending my day going into every old processing table in my system and 
| saving them, I was hoping I could use some sort of filepro utility would 
| allow me to just port all of these files over, I looked at the 
| documentation for cabe and only found flags to create tokenization 
| tables for a processing table from the prompt, not to recreate the 
| processing table in it's plain text form....any suggestions?  I'm 
| running fp 5.0.13R4 on Solaris.

You're in luck (in that you're on UNIX).  You'll be more in luck
if your system also has the KornShell, because the solution I'm
going to give you requires it.  It could be rewritten using the
Bourne shell and a version of AWK (to remove the "prc." from the
front of processing table names) if you dont' have the KornShell,
or you could use "cut" (ie: Prc=`echo $Prc | cut -b 5-28`).

----------------------------------- cut here ---------------------------------
#!/bin/ksh
#(@) Asciify - Saves all processing tables un-encoded.
ABE=ASCII ; PFPROG=/u/appl ; PFDATA=/u ; PFDIR=/appl
export ABE PFPROG PFDATA PFDIR
fPpath=$PFDATA$PFDIR/filepro ; cd $fPpath
for fPfile in [A-Za-z]*
do [[ -s ${fPfile}/map ]] || continue
   print $fPfile
   cd $fPfile
   for Prc in prc.*
   do [[ $Prc = "prc.*" ]] && continue
      Prc=${Prc#"prc."} ; print $Prc 
      print "3$Prc\n\033\033NNX" | $PFPROG/fp/dcabe $fPfile -y '' >/dev/null
   done
   cd $fPpath
done
exit
----------------------------------- cut here ---------------------------------

The script writes commands to the standard input of dcabe, which
is executed to edit all processing tables in each filePro File
directory.  The commands execute choice 3 on the dcabe menu, enter
the processing table name, then save the table and exit dcabe.

One possible problem is that dcabe is executed with the -y flag,
so no automatic processing table is associated with any table
being "asciified".

You can change to the "filepro" directory and execute:

  ls -l */prc.* | more

to see the date-time stamp on all processing tables.

If you have to break out of the script before all processing tables
have been processed, you can execyt the above to see where it was
when you did so, then edit the line "for fPfile in [A-Za-z]*" in the
script, changing the "[A-Za-z}" to pick up where you left off.

I've tested it, but there are no guarantees - use at your own risk
after having made a good, verified backup.

Bob

PS - All versions of filePro by default saved processing tables
     encoded (for security purposes), unless ABE=ASCII was set
     in its environment.

-- 
Bob Stockler  +-+  bob at trebor.iglou.com  +-+  http://members.iglou.com/trebor


More information about the Filepro-list mailing list