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 <wadsackREMOVE@attglobal.net>
------------------------------------------------------*/
and replace "attglobal" by "tds"
Re: Utility to convert certain select files?
On Fri, 26 Sep 2008 16:02:55 UTC, "Peter Wadsack" <not.really@spam.not> wrote:
[color=blue]
> I'm trying to figure out a rexx cmd that would do the following:[/color]
What are you having trouble with?
[color=blue]
> 1. wander through every directory
> on every drive,
> file by file[/color]
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.'
[color=blue]
> 2. look at the first few bytes of the file,
> to see if it is a PlanPerfect file.[/color]
How do you recognize a PlanPerfect file?
[color=blue]
> 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[/color]
How do you execute PlanPerfect from REXX?
[color=blue]
>
> I'm sure some of you will find this trivial!
>
> TIA
>
>
> Peter
>
> */------------------------------------------------------
> Peter Wadsack <wadsackREMOVE@attglobal.net>
> ------------------------------------------------------*/
>
> and replace "attglobal" by "tds"
>
>[/color]
--
Gordon Snider
Toronto, Canada
Re: Utility to convert certain select files?
On Fri, 26 Sep 2008 19:58:19 UTC, "Gordon Snider"
<no-spam@sympatico.ca> wrote:
[color=blue]
> On Fri, 26 Sep 2008 16:02:55 UTC, "Peter Wadsack" <not.really@spam.not> wrote:
>[color=green]
> > I'm trying to figure out a rexx cmd that would do the following:[/color][/color]
[color=blue]
> call SysFileTree drive||\*, files., 'OS'[/color]
Better to use:
call SysFileTree drive||\*, ' files.', 'OS'
as a general rule.
Re: Utility to convert certain select files?
Peter Wadsack wrote:[color=blue]
> is a PlanPerfect file.[/color]
Do I remember that as developed by the WordPerfect company? If so, wow... :-)
--
Michael Lueck
Lueck Data Systems
[url]http://www.lueckdatasystems.com/[/url]
Re: Utility to convert certain select files?
Le ven, 26 sep 2008 16:02:55 UTC, "Peter Wadsack"
<not.really@spam.not> a écrit:
[color=blue]
> 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[/color]
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
[url]http://pages.infinit.net/exovede[/url]
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 <jnqfnpxnggtybonyarg.k7t5s51.pminews@news.tds.net>, "Peter Wadsack" <not.really@spam.not> writes:[color=blue]
>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 <wadsackREMOVE@attglobal.net>
>------------------------------------------------------*/
>
>and replace "attglobal" by "tds"
>
>[/color]
-----------------------------------------------------------
Let Ignorance and Intolerance Rule!
Baden Kudrenecky
[email]baden@baden.nu[/email]
[url]http://baden.nu/[/url]
-----------------------------------------------------------
Re: Utility to convert certain select files?
Bob Eager wrote:[color=blue]
> On Fri, 26 Sep 2008 19:58:19 UTC, "Gordon Snider"[color=green]
>> call SysFileTree drive||\*, files., 'OS'[/color]
>
> Better to use:
>
> call SysFileTree drive||\*, ' files.', 'OS'
>
> as a general rule.[/color]
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
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" <baden@baden.nu> wrote in message
news:7GtGk.14$yW1.11@newsfe01.iad...[color=blue]
> 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 <jnqfnpxnggtybonyarg.k7t5s51.pminews@news.tds.net>, "Peter Wadsack"
> <not.really@spam.not> writes:[color=green]
>>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 <wadsackREMOVE@attglobal.net>
>>------------------------------------------------------*/
>>
>>and replace "attglobal" by "tds"
>>
>>[/color]
>
>
>
> -----------------------------------------------------------
> Let Ignorance and Intolerance Rule!
>
> Baden Kudrenecky
> [email]baden@baden.nu[/email]
> [url]http://baden.nu/[/url]
> -----------------------------------------------------------
>
>[/color]