Utility to convert certain select files? - OS2

This is a discussion on Utility to convert certain select files? - OS2 ; I'm trying to figure out a rexx cmd that would do the following: 1. wander through every directory on every drive, file by file 2. look at the first few bytes of the file, to see if it is a ...

+ Reply to Thread
Results 1 to 8 of 8

Thread: Utility to convert certain select files?

  1. Utility to convert certain select files?

    I'm trying to figure out a rexx cmd that would do the following:

    1. wander through every directory
    on every drive,
    file by file
    2. look at the first few bytes of the file,
    to see if it is a PlanPerfect file.
    3. If not, move on;
    if so, and the file is named, eg, namename.abc
    then run PlanPerfect with a macro [have this!]
    which will convert the file to a *.wk1 file,
    and save it with the name temp.wk1
    then rename temp.wk1 to namename_abc.wk1

    I'm sure some of you will find this trivial!

    TIA


    Peter

    */------------------------------------------------------
    Peter Wadsack
    ------------------------------------------------------*/

    and replace "attglobal" by "tds"



  2. Re: Utility to convert certain select files?

    On Fri, 26 Sep 2008 16:02:55 UTC, "Peter Wadsack" wrote:

    > I'm trying to figure out a rexx cmd that would do the following:


    What are you having trouble with?

    > 1. wander through every directory
    > on every drive,
    > file by file


    drives = SysDriveMap( , LOCAL)
    This will get you a list of all LOCAL drives.

    do i = 1 to words(drives)
    drive = word( drives, i)
    ...
    This should get you started in breaking up the list into individual
    entries.

    call SysFileTree drive||\*, files., 'OS'
    will put all the individual file names for a drive into stem 'files.'

    > 2. look at the first few bytes of the file,
    > to see if it is a PlanPerfect file.


    How do you recognize a PlanPerfect file?

    > 3. If not, move on;
    > if so, and the file is named, eg, namename.abc
    > then run PlanPerfect with a macro [have this!]
    > which will convert the file to a *.wk1 file,
    > and save it with the name temp.wk1
    > then rename temp.wk1 to namename_abc.wk1


    How do you execute PlanPerfect from REXX?

    >
    > I'm sure some of you will find this trivial!
    >
    > TIA
    >
    >
    > Peter
    >
    > */------------------------------------------------------
    > Peter Wadsack
    > ------------------------------------------------------*/
    >
    > and replace "attglobal" by "tds"
    >
    >



    --
    Gordon Snider
    Toronto, Canada

  3. Re: Utility to convert certain select files?

    On Fri, 26 Sep 2008 19:58:19 UTC, "Gordon Snider"
    wrote:

    > On Fri, 26 Sep 2008 16:02:55 UTC, "Peter Wadsack" wrote:
    >
    > > I'm trying to figure out a rexx cmd that would do the following:


    > call SysFileTree drive||\*, files., 'OS'


    Better to use:

    call SysFileTree drive||\*, ' files.', 'OS'

    as a general rule.



  4. Re: Utility to convert certain select files?

    Peter Wadsack wrote:
    > is a PlanPerfect file.


    Do I remember that as developed by the WordPerfect company? If so, wow... :-)

    --
    Michael Lueck
    Lueck Data Systems
    http://www.lueckdatasystems.com/

  5. Re: Utility to convert certain select files?

    Le ven, 26 sep 2008 16:02:55 UTC, "Peter Wadsack"
    a écrit:

    > I'm trying to figure out a rexx cmd that would do the following:
    >
    > 1. wander through every directory
    > on every drive,
    > file by file
    > 2. look at the first few bytes of the file,
    > to see if it is a PlanPerfect file.
    > 3. If not, move on;
    > if so, and the file is named, eg, namename.abc
    > then run PlanPerfect with a macro [have this!]
    > which will convert the file to a *.wk1 file,
    > and save it with the name temp.wk1
    > then rename temp.wk1 to namename_abc.wk1


    Well, as for myself, I would first find the file(s) named
    namename.abc and for each of them found, look if the first bytes
    correspond to a PlanPerfect file and, if the result is positive, do
    the conversion and renaming. That should proves faster than looking
    at each and every files. ;-)

    --
    Salut,

    Michel (sur eComStation 1.2 / Warp 4.52)
    ICQ #13376913
    http://pages.infinit.net/exovede

  6. Re: Utility to convert certain select files?

    Hi Peter:

    OS/2 has always had PMSeek which is ideally suited
    for this task.

    Just enter a wildcard for the filemask, the
    characters you are seeking for the "Text", and the
    macro application you wish to use for the "Editor", and
    they will all open in your macro application.

    The only drawback is that this method does not
    properly parse spaces in the path. It will find the
    file, but the application will not open the file.

    later,
    lin Baden

    In , "Peter Wadsack" writes:
    >I'm trying to figure out a rexx cmd that would do the following:
    >
    >1. wander through every directory
    > on every drive,
    > file by file
    >2. look at the first few bytes of the file,
    > to see if it is a PlanPerfect file.
    >3. If not, move on;
    > if so, and the file is named, eg, namename.abc
    > then run PlanPerfect with a macro [have this!]
    > which will convert the file to a *.wk1 file,
    > and save it with the name temp.wk1
    > then rename temp.wk1 to namename_abc.wk1
    >
    >I'm sure some of you will find this trivial!
    >
    >TIA
    >
    >
    >Peter
    >
    >*/------------------------------------------------------
    > Peter Wadsack
    >------------------------------------------------------*/
    >
    >and replace "attglobal" by "tds"
    >
    >




    -----------------------------------------------------------
    Let Ignorance and Intolerance Rule!

    Baden Kudrenecky
    baden@baden.nu
    http://baden.nu/
    -----------------------------------------------------------



  7. Re: Utility to convert certain select files?

    Bob Eager wrote:
    > On Fri, 26 Sep 2008 19:58:19 UTC, "Gordon Snider"
    >> call SysFileTree drive||\*, files., 'OS'

    >
    > Better to use:
    >
    > call SysFileTree drive||\*, ' files.', 'OS'
    >
    > as a general rule.


    And even better to use

    call SysFileTree drive||\*, 'FILES.', 'OS'

    because not all functions that take symbol names as strings will convert
    them to uppercase internally.


    Marcel

  8. Re: Utility to convert certain select files?

    Why not try SearchPlus, (its on Hobbes) this program has a powerful search
    and execute combination allowing command line like functions on selected
    files.
    You can further trim the files you want to select by file size, file date
    etc

    Keith
    "Baden Kudrenecky" wrote in message
    news:7GtGk.14$yW1.11@newsfe01.iad...
    > Hi Peter:
    >
    > OS/2 has always had PMSeek which is ideally suited
    > for this task.
    >
    > Just enter a wildcard for the filemask, the
    > characters you are seeking for the "Text", and the
    > macro application you wish to use for the "Editor", and
    > they will all open in your macro application.
    >
    > The only drawback is that this method does not
    > properly parse spaces in the path. It will find the
    > file, but the application will not open the file.
    >
    > later,
    > lin Baden
    >
    > In , "Peter Wadsack"
    > writes:
    >>I'm trying to figure out a rexx cmd that would do the following:
    >>
    >>1. wander through every directory
    >> on every drive,
    >> file by file
    >>2. look at the first few bytes of the file,
    >> to see if it is a PlanPerfect file.
    >>3. If not, move on;
    >> if so, and the file is named, eg, namename.abc
    >> then run PlanPerfect with a macro [have this!]
    >> which will convert the file to a *.wk1 file,
    >> and save it with the name temp.wk1
    >> then rename temp.wk1 to namename_abc.wk1
    >>
    >>I'm sure some of you will find this trivial!
    >>
    >>TIA
    >>
    >>
    >>Peter
    >>
    >>*/------------------------------------------------------
    >> Peter Wadsack
    >>------------------------------------------------------*/
    >>
    >>and replace "attglobal" by "tds"
    >>
    >>

    >
    >
    >
    > -----------------------------------------------------------
    > Let Ignorance and Intolerance Rule!
    >
    > Baden Kudrenecky
    > baden@baden.nu
    > http://baden.nu/
    > -----------------------------------------------------------
    >
    >




+ Reply to Thread