Converting old file pro processing tables

Brian K. White brian at aljex.com
Wed Jul 26 15:19:08 PDT 2006


----- Original Message ----- 
From: "Bob Stockler" <bob at trebor.iglou.com>
To: "fplist2" <filepro-list at seaslug.org>
Sent: Wednesday, July 26, 2006 3:01 PM
Subject: Re: Converting old file pro processing tables


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

Two problems:

$PFME changes the behaviour of filepro input prompts and so you should hard 
code it in the script to match the expectations of the string you are 
feeding dcabe.

$TERM changes what is really correct in place of EscEsc, so you should hard 
code TERM=<something known in everyones fp/termcap> in the script too.
I should have just done that myself instead of making a variable and telling 
the user in comments that they have to edit that variable.

The one I made a few years ago uses the F3 insert line key for some reason I 
no longer remember.
I capture it by using tput kf3

http://www.aljex.com/bkw/filepro/prc2ascii

Ahh it's prepending a line at the top of every table it touches, then 
stripping it off again outside of dcabe.
I can only guess I wanted the thing to also strip all site passwords along 
the way but neglected to document that part in the comments.
Stupid too, not simply specifying the shell at the top and using the print 
command instead of echo and all those comments to explain why echo might be 
a problem.

Brian K. White  --  brian at aljex.com  --  http://www.aljex.com/bkw/
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro  BBx    Linux  SCO  FreeBSD    #callahans  Satriani  Filk!



More information about the Filepro-list mailing list