a free useful script

Richard D. Williams richard at appgrp.net
Mon Dec 15 15:43:45 PST 2014


Nancy,

Your input is always welcome.

Richard

On 12/15/2014 4:47 PM, Nancy Palmquist wrote:
> Richard,
>
> I guess the snip of filepro you displayed made me think you were doing 
> something in filepro.
>
> Sorry I got off on the wrong track on that one.
>
> Nancy
> On 12/15/2014 4:49 PM, Richard D. Williams wrote:
>> Nancy,
>>
>> I believe you are making the same requirement.
>>
>> #  This routine requires all tables saved in ASCII.
>>
>> If ABE is not set to ASCII when a processing table is recorded, it is 
>> not in ASCII format.
>> Therefore, grep will not produce any response.
>>
>> We are getting to the same point.  I just format my response 
>> differently and I ma not limited to just filepro files.
>> I could use search_it where  I am in /usr/local/bin and search script 
>> as well.
>>
>> Richard
>>
>> On 12/15/2014 2:26 PM, Nancy Palmquist wrote:
>>> Richard,
>>>
>>> I don't quite understand the requirement for filepro on a *IX system 
>>> to do this.
>>>
>>> I am supplying the script I have used forever:
>>> #---------------------------------------------------------------------------------------------------------- 
>>>
>>> #  This routine requires all tables saved in ASCII.
>>> #  Nancy Palmquist  Many Years Ago - Actual Date lost but prior to 2001
>>> #
>>> if test -z "$PFDIR"
>>>         then echo -n "PFDIR(/appl)=";read PFDIR
>>>         fi
>>> #  Program name is really not necessary and can be commented out.
>>>         if test -z "$PFPROG"
>>>         then echo -n "PFPROG(/appl50)=";read PFPROG
>>>         fi
>>> export PFPROG PFDIR
>>> echo Programs $PFPROG  Data $PFDIR
>>> read key
>>> cd $PFDIR/filepro
>>> echo -n "Files to process (use wildcards if necessary) : ";read w
>>> echo -n "Grep for: ";read find
>>> echo -n "Written to /tmp/[ temporary filename] : ";read findnm
>>> >/tmp/files.print
>>> >/tmp/grep.$findnm
>>> for x in $w
>>> do
>>> if test -d $x
>>> then
>>> echo scanning process $x for $find
>>>         cd $x
>>>         echo $x >>/tmp/files.print
>>>         for t in `ls prc.*`
>>>         do
>>>                 tbl=`echo $t | sed '1,$s/prc.//'`
>>>                 echo Now searching $x   $tbl
>>>                 echo "--------------------"  $x  $tbl 
>>> >>/tmp/grep.$findnm
>>>                 grep "$find" $t >>/tmp/grep.$findnm
>>>         done
>>> cd ..
>>> fi
>>> done
>>> less /tmp/grep.$findnm
>>> #---------------------------------------------------------------------------------------------------- 
>>>
>>>
>>>
>>> Output lists each filename Process table name and then any reference 
>>> to the search term.  So if I wanted to find "invoice" I need to 
>>> review the process table called c_mkinv in this file.
>>>
>>> SAMPLE OUTPUT
>>> -------------------- stjob Pending
>>> -------------------- stjob Pendingv
>>> -------------------- stjob automatic
>>> -------------------- stjob c_accesslvl
>>> -------------------- stjob c_mkinv
>>> ::lookup inv=invoice r=free -nx:
>>> ::lookup inv=invoice r=(invrec) -nxp:
>>> :'add technician to invoice if given:lookup tech=stjobtech k=1 i=a 
>>> -bxp:
>>> :inv(4) eq "C" or inv(4) eq "B":it=inv(68);'invoice type 
>>> INVOICE/CREDIT:
>>> :'add line items to invoice - Only need logic that:'happens for an 
>>> Open order:
>>> ::'gosub scaninv    this looks to see if line is already on invoice:
>>> -------------------- stjob cleanup
>>> -------------------- stjob getItems
>>> -------------------- stjob getServs
>>>
>>> Nancy
>>>
>>> On 12/15/2014 1:51 PM, Richard D. Williams wrote:
>>>> To All:
>>>>
>>>> You may already have something like this, but I thought I would share.
>>>> It is the holiday season.
>>>>
>>>> Merry Christmas/Happy Hanukkah to all,
>>>>
>>>> Richard D. Williams
>>>>
>>>> Required: all tables must be ascii format.
>>>> If you need to convert all tables in a file, just do this:
>>>> /appl/fp/rcabe filename -ca
>>>>
>>>> # cat SEARCH_IT
>>>> rm -f /tmp/$LOGNAME.txt
>>>> for file in `ls -1 $1`; do if grep -q "$2" "$file";
>>>>  then echo $file >> /tmp/$LOGNAME.txt; cat $file | grep -n "$2" >> 
>>>> /tmp/$LOGNAME
>>>> .txt; echo "" >> /tmp/$LOGNAME.txt; fi; done;
>>>> vi /tmp/$LOGNAME.txt
>>>>
>>>> i.e.
>>>> [/appl/filepro/r_process_office]# SEARCH_IT "prc.*" "(268)"
>>>>
>>>> yields:
>>>> prc.enter_txoag_job
>>>> 67:::P_PROC(8)=@TD+"30";P_PROC(9)=@TM;P_PROC(268)=@TD+"0";P_PROC(320)="I": 
>>>>
>>>>
>>>> prc.pcp2pcp_owe
>>>> 41:::d(8,yymd)=P_PROC(268)+"0":
>>>> 58::P_PROC(268) ge "05/03/04":w="P_CHG at a":
>>>> 121::P_CLT(116) eq ja and P_PROC(268) ge P_CLT(@CD):amf_client="Y":
>>>> 133::P_PROC(268) ge "05/03/04":w="P_CHG at a":
>>>> 192:::d(8,yymd)=franinv(268)+"0":
>>>> 205::franinv(268) ge "05/03/04":w="P_CHG at a":
>>>> 206::franinv(268) lt "05/03/04":w="P_CHG":
>>>> 214::not amf and P_CLT(116) ne "" and franinv(268) ge P_CLT(@CD) 
>>>> and franinv(214) eq "":jl(9,.)=jl+(famt(n)-(famt(n)-am)):
>>>> 219:::hg(8,yymd)=franinv(268)+"0":
>>>>
>>>> -------------- next part --------------
>>>> An HTML attachment was scrubbed...
>>>> URL: 
>>>> <http://mailman.celestial.com/pipermail/filepro-list/attachments/20141215/d5f77a9c/attachment.html>
>>>> _______________________________________________
>>>> Filepro-list mailing list
>>>> Filepro-list at lists.celestial.com
>>>> Subscribe/Unsubscribe/Subscription Changes
>>>> http://mailman.celestial.com/mailman/listinfo/filepro-list
>>>>
>>>
>>
>> -------------- next part --------------
>> An HTML attachment was scrubbed...
>> URL: 
>> <http://mailman.celestial.com/pipermail/filepro-list/attachments/20141215/5ad9566e/attachment.html>
>> _______________________________________________
>> Filepro-list mailing list
>> Filepro-list at lists.celestial.com
>> Subscribe/Unsubscribe/Subscription Changes
>> http://mailman.celestial.com/mailman/listinfo/filepro-list
>>
>



More information about the Filepro-list mailing list