Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.sys.acorn.apps > #2609 > unrolled thread

Search & Replace

Started byErving <erving@riscos.org>
First post2012-01-08 10:47 +0000
Last post2012-01-15 15:20 +0000
Articles 16 — 10 participants

Back to article view | Back to comp.sys.acorn.apps


Contents

  Search & Replace Erving <erving@riscos.org> - 2012-01-08 10:47 +0000
    Re: Search & Replace Paul Sprangers <Paul@sprie.nl> - 2012-01-08 12:27 +0100
      Re: Search & Replace News poster <workstuff@mail.com> - 2012-01-09 11:09 +0100
      Re: Search & Replace Erving <erving@riscos.org> - 2012-01-09 10:28 +0000
        Re: Search & Replace Vince M Hudd <vinceh@softrock.co.uk> - 2012-01-10 15:41 +0000
          Re: Search & Replace Martin Wuerthner <spamtrap@mw-software.com> - 2012-01-10 23:40 +0100
            Re: Search & Replace Vince M Hudd <vinceh@softrock.co.uk> - 2012-01-10 22:54 +0000
              Re: Search & Replace druck <news@druck.org.uk> - 2012-01-11 20:30 +0000
                Re: Search & Replace Erving <erving@riscos.org> - 2012-01-15 11:03 +0000
                  Re: Search & Replace Harriet Bazley <bazley@feathermail.co.uk> - 2012-01-17 23:15 +0000
                    Re: Search & Replace Dave Symes <dave@triffid.co.uk> - 2012-01-18 07:32 +0000
                      Re: Search & Replace "David Holden" <SpamBin@apdl.co.uk> - 2012-01-18 09:30 +0000
                        Re: Search & Replace Dave Symes <dave@triffid.co.uk> - 2012-01-18 19:48 +0000
                      Re: Search & Replace Chris Johnson <chrisjohnson+news@spamcop.net> - 2012-01-18 10:25 +0000
                        Re: Search & Replace Harriet Bazley <bazley@feathermail.co.uk> - 2012-01-19 04:04 +0000
        Re: Search & Replace Erving <erving@riscos.org> - 2012-01-15 15:20 +0000

#2609 — Search & Replace

FromErving <erving@riscos.org>
Date2012-01-08 10:47 +0000
SubjectSearch & Replace
Message-ID<81da4a4e52.kbarter@orpheusnet.co.uk>
Is there any easy way to apply a series of search and replace strings 
to a piece of text, from a list or table? Do any editors have this 
functionality? I suppose I could maybe drop the text into Pipedream 
and write a macro to do it, but is there a simpler way?

[toc] | [next] | [standalone]


#2610

FromPaul Sprangers <Paul@sprie.nl>
Date2012-01-08 12:27 +0100
Message-ID<524e4e73a9Paul@sprie.nl>
In reply to#2609
In article <81da4a4e52.kbarter@orpheusnet.co.uk>,
   Erving <erving@riscos.org> wrote:

> Is there any easy way to apply a series of search and replace strings 
> to a piece of text, from a list or table? Do any editors have this 
> functionality? I suppose I could maybe drop the text into Pipedream 
> and write a macro to do it, but is there a simpler way?

You might try !ConvText, which can be downloaded here:
http://www.riscos.sprie.nl/Downloads/ConvText.zip

StrongHelp file is inside.

Kind regards,
Paul Sprangers

[toc] | [prev] | [next] | [standalone]


#2624

FromNews poster <workstuff@mail.com>
Date2012-01-09 11:09 +0100
Message-ID<c736cb4e52.news@mistymornings.net>
In reply to#2610
In message <524e4e73a9Paul@sprie.nl>
          Paul Sprangers <Paul@sprie.nl> wrote:

> In article <81da4a4e52.kbarter@orpheusnet.co.uk>,
>    Erving <erving@riscos.org> wrote:
> 
> > Is there any easy way to apply a series of search and replace strings 
> > to a piece of text, from a list or table? Do any editors have this 
> > functionality? I suppose I could maybe drop the text into Pipedream 
> > and write a macro to do it, but is there a simpler way?
> 
> You might try !ConvText, which can be downloaded here:
> http://www.riscos.sprie.nl/Downloads/ConvText.zip
> 
An essential piece of RISC OS software (IMHO).
 Cheers Stan
-- 
An Iyonix and a Beagleboard xM in Buskerud.

http://mistymornings.net 

[toc] | [prev] | [next] | [standalone]


#2627

FromErving <erving@riscos.org>
Date2012-01-09 10:28 +0000
Message-ID<4df1cc4e52.kbarter@orpheusnet.co.uk>
In reply to#2610
[Posted and mailed]

In message <524e4e73a9Paul@sprie.nl>
          Paul Sprangers <Paul@sprie.nl> wrote:

> In article <81da4a4e52.kbarter@orpheusnet.co.uk>,
>    Erving <erving@riscos.org> wrote:

>> Is there any easy way to apply a series of search and replace strings
>> to a piece of text, from a list or table? Do any editors have this
>> functionality? I suppose I could maybe drop the text into Pipedream
>> and write a macro to do it, but is there a simpler way?

> You might try !ConvText, which can be downloaded here:
> http://www.riscos.sprie.nl/Downloads/ConvText.zip

> StrongHelp file is inside.

> Kind regards,
> Paul Sprangers

Thank you. This is a great utility, with it I have been able to more 
or less sort out my problem. For some as yet to be discovered reason 
my Impression exports from version2 of Organizer have the colour 
strings all wrong (I have never had problems with V1)

I have made a script (appended in case anyone else has this problem) 
which corrects these with the exception of orange, yellow and two of 
the grays, all of which exported with a black string:
 ({fontcolour rgb=(0,0,0)}) which the script changes to mid gray.


A programme which would work in the same way with an Impression 
document would be most useful (I know one can export it as a text 
document with styles, edit it and reimport it; however my documents 
tend to be made up of bits of saved sections with styles which somehow 
have {"style" on}s with out matching {"style" off}s. This works OK so 
long as each bit is added to the start of the document, but if then  
exported as text has to be corrected before it will reimport corectly)


SCRIPT:OrgCol   |This is the name of the script
{fontcolour rgb=(3.921568628E-3,0,0)}:{fontcolour 
rgb=(0.6901960785,0.6901960785,0.6901960785)}|Colour 2 pale gray

{fontcolour rgb=(1,1,1)}:{fontcolour 
rgb=(0.5647058825,0.5647058825,0.5647058825)}|Colour 3 light gray

{fontcolour rgb=(0,0,0)}:{fontcolour 
rgb=(0.3137254902,0.3137254902,0.3137254902)}|All 'blacks': Colours 
1,4,5 gray and 9 yellow & 14 orange, made mid gray

{fontcolour rgb=(0.9450980392,0,0.02745098039)}:{fontcolour 
rgb=(0.1882352941,0.1882352941,0.1882352941)}|Colour6 dark gray

{fontcolour rgb=(0.2627450981,0.02352941177,0)}:{fontcolour 
rgb=(0,0,0)}|Colour 7 black

{fontcolour rgb=(0.2666666667,0.02352941177,0)}:{fontcolour 
rgb=(0,0.2509803922,0.5647058825)}|Colour 8 blue

{fontcolour rgb=(0.1921568628,0.05098039216,0.1254901961)}:{fontcolour 
rgb=(0,0.7529411765,0)}Colour 10 light green

{fontcolour rgb=(0.1882352941,0.1921568628,0.1960784314)}:{fontcolour 
rgb=(0.8156862746,0,0)}|Colour 11 red

{fontcolour rgb=(0.9411764706,1,1)}:{fontcolour 
rgb=(0.8784313726,0.8784313726,0.6901960785)}|Colour 12 cream

{fontcolour rgb=(0.05882352941,0,0)}:{fontcolour 
rgb=(0.3137254902,0.5019607844,0)}|Colour 13 mud green

{fontcolour rgb=(3.921568628E-3,0,0.1529411765)}:{fontcolour 
rgb=(0,0.6901960785,0.9411764706)}|Colour 15 cyan

[toc] | [prev] | [next] | [standalone]


#2646

FromVince M Hudd <vinceh@softrock.co.uk>
Date2012-01-10 15:41 +0000
Message-ID<mpro.lxla9i00ah5wj04o0.vinceh@softrock.co.uk>
In reply to#2627
Erving <erving@riscos.org> wrote:

[ConvText]

> A programme which would work in the same way with an Impression document
> would be most useful 

I've never been an Impression user, so I know nothing of its internal
format, etc, but that might not matter.

With the latest versions of WebChange, you can specify the filetypes it will
operate on. I'm on the wrong machine, in the wrong location at the moment,
but IIRC, Choices:WebChange.Text (or is it TextTypes?). This file specifies
the types of file WebChange will treat as 'textual' filetypes (which means
processes such as search and replace will work on them, but not processes
that do anything with HTML markup). So, in here, you'd add the filetype for
the Impression files you wish to process.

You might also want to put the filetype in the 'Draggables' file in the same
location, so you can drag the Impression file onto WebChange's front end.

The search and replace - like just about all of WebChange's functions - is
available from the Script language. This is done in a different way to
ConvText, but would look something like:


----8<----
WebChange.Script

; Colour 2 pale gray

Replace.ChangeFrom = "{fontcolour rgb=(3.921568628E-3,0,0)}"
Replace.ChangeTo = "{fontcolour
rgb=(0.6901960785,0.6901960785,0.6901960785)}"
Content.Replace

; Colour 3 light gray

Replace.ChangeFrom = "{fontcolour rgb=(1,1,1)}"
Replace.ChangeTo = "{fontcolour
rgb=(0.5647058825,0.5647058825,0.5647058825)}"
Content.Replace

[Etc]
----8<----

You'd then drag the impression file onto WebChange whenever you need to make
the changes, drag the script onto the relevant icon (and if it's the only
one you ever use, WebChange will remember it), and run it.

In theory, anyway.

Obviously, test on a copy of a file, just to be sure.

http://www.webchange.co.uk

-- 
Soft Rock Software:                   http://www.softrock.co.uk
Vince M Hudd:                         http://misc.vinceh.com/about-vinceh/
RISCOSitory:                          http://www.riscository.com

[toc] | [prev] | [next] | [standalone]


#2652

FromMartin Wuerthner <spamtrap@mw-software.com>
Date2012-01-10 23:40 +0100
Message-ID<05ce934f52.martin@bach.planiverse.com>
In reply to#2646
In message <mpro.lxla9i00ah5wj04o0.vinceh@softrock.co.uk>
          Vince M Hudd <vinceh@softrock.co.uk> wrote:

> Erving <erving@riscos.org> wrote:

> [ConvText]

>> A programme which would work in the same way with an Impression document
>> would be most useful

> I've never been an Impression user, so I know nothing of its internal
> format, etc, but that might not matter.

> With the latest versions of WebChange, you can specify the filetypes it will
> operate on. I'm on the wrong machine, in the wrong location at the moment,
> but IIRC, Choices:WebChange.Text (or is it TextTypes?). This file specifies
> the types of file WebChange will treat as 'textual' filetypes (which means
> processes such as search and replace will work on them, but not processes
> that do anything with HTML markup). So, in here, you'd add the filetype for
> the Impression files you wish to process.

Since Impression files are in a binary format, that can only work in 
very limited circumstances. Any attempt to replace a string by a 
string with a different length will immediately break the file.

-- 
Martin
---------------------------------------------------------------------
Martin Wuerthner         MW Software      http://www.mw-software.com/
        RISC OS Software for Design, Printing and Publishing
---------------------------------------------------------------------

[toc] | [prev] | [next] | [standalone]


#2653

FromVince M Hudd <vinceh@softrock.co.uk>
Date2012-01-10 22:54 +0000
Message-ID<mpro.lxluat009i9pl028k.vinceh@softrock.co.uk>
In reply to#2652
Martin Wuerthner <spamtrap@mw-software.com> wrote:
> In message <mpro.lxla9i00ah5wj04o0.vinceh@softrock.co.uk>
>           Vince M Hudd <vinceh@softrock.co.uk> wrote:

[...]

> Since Impression files are in a binary format, that can only work in very
> limited circumstances. Any attempt to replace a string by a string with a
> different length will immediately break the file.

I must have misunderstood the preceeding poster - as well as (not entirely
surprisingly) the Impression file format.

I thought the example ConvText script given was being applied to an
Impression file (but didn't work because of the filetype) and therefore
assumed that the contents of the Impression document were stored in a
textual fashion (not unlike Fireworkz, for example - or PipeDream, which is
arguably a better example, because I used to regularly apply WebChange
scripts to PipeDream files when I still used it.)

However, if Impression's file format is binary, as you say, then you are
obviously quite correct, and my suggestion shouldn't be followed.

-- 
Soft Rock Software:                   http://www.softrock.co.uk
Vince M Hudd:                         http://misc.vinceh.com/about-vinceh/
RISCOSitory:                          http://www.riscository.com

[toc] | [prev] | [next] | [standalone]


#2666

Fromdruck <news@druck.org.uk>
Date2012-01-11 20:30 +0000
Message-ID<jekri1$pjg$1@dont-email.me>
In reply to#2653
On 10/01/2012 22:54, Vince M Hudd wrote:
> I thought the example ConvText script given was being applied to an
> Impression file (but didn't work because of the filetype) and therefore
> assumed that the contents of the Impression document were stored in a
> textual fashion (not unlike Fireworkz, for example - or PipeDream, which is
> arguably a better example, because I used to regularly apply WebChange
> scripts to PipeDream files when I still used it.)
>
> However, if Impression's file format is binary, as you say, then you are
> obviously quite correct, and my suggestion shouldn't be followed.

You can export the text from a frame in DDE format (Impression's tagged 
text format), manipulate it, and reload it in to the document. You can 
also do the same with Ovation's tagged format.

Incidentally my ARMalyser ARM code analyser can produce syntax coloured 
output in Impression and Ovation text formats, as well as HTML. It can 
also support just about any other tagged format via a definition file.

---druck

[toc] | [prev] | [next] | [standalone]


#2732

FromErving <erving@riscos.org>
Date2012-01-15 11:03 +0000
Message-ID<b520e75152.kbarter@orpheusnet.co.uk>
In reply to#2666
In message <jekri1$pjg$1@dont-email.me>
          druck <news@druck.org.uk> wrote:

> You can export the text from a frame in DDE format (Impression's tagged
> text format), manipulate it, and reload it in to the document. You can
> also do the same with Ovation's tagged format.

This is fine if the DDE is formatted correctly, which it is not in my 
case.

When saved in DDE format a file is produced which which begins with  
settings used in the document, including definitions of all styles, 
followed with the text interspersed with style changes viz:
"text in base style {"Style A" on} text with style A applied {" Style 
B" on} text with styles A & B applied {"Style A" off} text with style 
B applied {"Style B" off}

The first part of this file can be discarded and the resultant smaller 
file can be dragged into a base Impression document with styles 
already set, and these style definitions can be different from those 
originally used.

I have a directory of some 350 cribs of Scottish dances saved in this 
way all with about a dozen styles which would make any typographer 
shudder but designed to make interpretation simple (for an example see
http://www.londonhighlandclub.co.uk/Ncrib.pdf )

However, somehow some of these DDE files do not have some of the
{"xxx" off} end of style markers. If these files are successively 
dragged into a base document each will be affected by the 'hanging' 
styles of those before; however if each file is dragged to the start 
of the document no problems occur, unless that is one saves the 
document in DDE format and then reimports it when the styles go 
haywire.
There is no problem applying a series of search and replace actions in 
Impression, and I would like a way to automate this for a predefined
set.
Alternatively it would be more useful to have some way to add the 
missing {"xxx" off}s to the end of these files.
I wish there was an option in Impression to save text with styles but 
without the preamble of style definitions, which I have to delate each 
time I save on of these files.

[toc] | [prev] | [next] | [standalone]


#2766

FromHarriet Bazley <bazley@feathermail.co.uk>
Date2012-01-17 23:15 +0000
Message-ID<a5cd315352.harriet@blueyonder.co.uk>
In reply to#2732
On 15 Jan 2012 as I do recall,
          Erving  wrote:

[snip]

> I wish there was an option in Impression to save text with styles but
> without the preamble of style definitions, which I have to delate each
> time I save on of these files.
>

There is;  I had the same problem years and years ago!

http://www.starfighter.acornarcade.com/mysite/utilities.htm#stripstyle

You might even find StylePick useful, which allows you to export styles
from DDF selectively:
http://www.starfighter.acornarcade.com/mysite/utilities.htm#stylepick


-- 
Harriet Bazley                     ==  Loyaulte me lie ==

He who hesitates is sometimes saved.

[toc] | [prev] | [next] | [standalone]


#2772

FromDave Symes <dave@triffid.co.uk>
Date2012-01-18 07:32 +0000
Message-ID<52535f519adave@triffid.co.uk>
In reply to#2766
In article <a5cd315352.harriet@blueyonder.co.uk>,
   Harriet Bazley <bazley@feathermail.co.uk> wrote:
> On 15 Jan 2012 as I do recall,
>           Erving  wrote:

> [snip]

> > I wish there was an option in Impression to save text with styles but
> > without the preamble of style definitions, which I have to delate each
> > time I save on of these files.
> >

> There is;  I had the same problem years and years ago!

> http://www.starfighter.acornarcade.com/mysite/utilities.htm#stripstyle

> You might even find StylePick useful, which allows you to export styles
> from DDF selectively:
> http://www.starfighter.acornarcade.com/mysite/utilities.htm#stylepick

Please, can we take a step back as there's something I don't understand.

Why would you want to Save text with styles, then manually remove the
style definitions?

Seems a pointless exercise.
Just save as Text

Dave

-- 

Dave Triffid

[toc] | [prev] | [next] | [standalone]


#2774

From"David Holden" <SpamBin@apdl.co.uk>
Date2012-01-18 09:30 +0000
Message-ID<9nnhqfFb4jU1@mid.individual.net>
In reply to#2772
On 18-Jan-2012, Dave Symes <dave@triffid.co.uk> wrote:

> Why would you want to Save text with styles, then manually remove the
> style definitions?
>
> Seems a pointless exercise.
> Just save as Text

Because there's a lot of data you might want that's removed with the styles.
For example, bold and italic, justification, headings, etc. You don't need
the definitions of these things necessarily but if you want to convert the
document to a sensible text document rather than just a block of plain text
then they're very useful..

Removing the styles header is pretty trivial anyway.

-- 
David Holden  -  APDL  -  <http://www.apdl.co.uk>

[toc] | [prev] | [next] | [standalone]


#2789

FromDave Symes <dave@triffid.co.uk>
Date2012-01-18 19:48 +0000
Message-ID<5253a2ac55dave@triffid.co.uk>
In reply to#2774
In article <9nnhqfFb4jU1@mid.individual.net>,
   David Holden <SpamBin@apdl.co.uk> wrote:

> On 18-Jan-2012, Dave Symes <dave@triffid.co.uk> wrote:

> > Why would you want to Save text with styles, then manually remove the
> > style definitions?
> >
> > Seems a pointless exercise.
> > Just save as Text

> Because there's a lot of data you might want that's removed with the
> styles. For example, bold and italic, justification, headings, etc. You
> don't need the definitions of these things necessarily but if you want
> to convert the document to a sensible text document rather than just a
> block of plain text then they're very useful..

> Removing the styles header is pretty trivial anyway.

Thanks DH and CJ, now I see.

Dave

-- 

Dave Triffid

[toc] | [prev] | [next] | [standalone]


#2775

FromChris Johnson <chrisjohnson+news@spamcop.net>
Date2012-01-18 10:25 +0000
Message-ID<52536f21a4chrisjohnson+news@spamcop.net>
In reply to#2772
In article <52535f519adave@triffid.co.uk>,
   Dave Symes <dave@triffid.co.uk> wrote:
> Why would you want to Save text with styles, then manually remove
> the style definitions?

I guess one possibility is when merging documents that have the same
style names, but different style definitions. I have certainly done
that in the past when I used to use Publisher. It is annoying to
import some 'text with styles' and find the main document has changed.

-- 
Chris Johnson

[toc] | [prev] | [next] | [standalone]


#2791

FromHarriet Bazley <bazley@feathermail.co.uk>
Date2012-01-19 04:04 +0000
Message-ID<1121d05352.harriet@blueyonder.co.uk>
In reply to#2775
On 18 Jan 2012 as I do recall,
          Chris Johnson  wrote:

> In article <52535f519adave@triffid.co.uk>,
>    Dave Symes <dave@triffid.co.uk> wrote:
> > Why would you want to Save text with styles, then manually remove
> > the style definitions?
>
> I guess one possibility is when merging documents that have the same
> style names, but different style definitions. I have certainly done
> that in the past when I used to use Publisher. It is annoying to
> import some 'text with styles' and find the main document has changed.
>
One reason why I wanted to do it was to import sections of text from
complicated documents - if you strip the style header then Impression
will only create the styles actually found in the DDF (and if you're
pasting from multiple sources into one 'template' document, you get
uniform formatting that way), while if you paste the DDF as exported,
Impression will potentially create a menu with dozens of unused styles
from elsewhere in the magazine/book/etc rather than just the ones in
that extract.

-- 
Harriet Bazley                     ==  Loyaulte me lie ==

Sattinger's Law:  It works better if you plug it in.

[toc] | [prev] | [next] | [standalone]


#2731

FromErving <erving@riscos.org>
Date2012-01-15 15:20 +0000
Message-ID<4ea6fe5152.kbarter@orpheusnet.co.uk>
In reply to#2627
In message <4df1cc4e52.kbarter@orpheusnet.co.uk>
          Erving <erving@riscos.org> wrote:

> [Posted and mailed]

> In message <524e4e73a9Paul@sprie.nl>
>           Paul Sprangers <Paul@sprie.nl> wrote:

>> In article <81da4a4e52.kbarter@orpheusnet.co.uk>,
>>    Erving <erving@riscos.org> wrote:

>>> Is there any easy way to apply a series of search and replace strings
>>> to a piece of text, from a list or table? Do any editors have this
>>> functionality? I suppose I could maybe drop the text into Pipedream
>>> and write a macro to do it, but is there a simpler way?

>> You might try !ConvText, which can be downloaded here:
>> http://www.riscos.sprie.nl/Downloads/ConvText.zip

>> StrongHelp file is inside.

>> Kind regards,
>> Paul Sprangers

> Thank you. This is a great utility, with it I have been able to more
> or less sort out my problem. For some as yet to be discovered reason
> my Impression exports from version2 of Organizer have the colour
> strings all wrong (I have never had problems with V1)

<snip>

It turns out this was due to a small change in the run image code 
which will be corrected in the next upgrade. I will still find it 
useful to change the colour strings in the export file, especially for 
yellow to make it more visible when printed. Also it makes it possible 
to print a larger range of colours than the 16 palette colours 
(including 8 grays) available in organizer by say converting same 
grays to print in other colours.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.sys.acorn.apps


csiph-web