Skip to main content
1-Visitor
May 25, 2011
Question

Troubles finding a numerically coded entity

  • May 25, 2011
  • 7 replies
  • 1423 views
Hello Adepters,

First of all, my apologies if I managed to post this thread on the forum
already. It looks like it won't work.

I'm trying to use ACL to find and replace some numerically coded
entities by their named entity.
As an exemple : find " ", replace with " ".

I tried the following things :
find -es / /
find -es / /
But none work. Which mean I get the message 'String not found'.

The only thing I could manage was to cut and paste the caracter shown in
my edit window to the command line.
But I'm unable to do the same thing in my ACL file, because when I paste
that caracter in a text editor, I end with an '?'

Any input or idea on how to handle those entity with ACL is welcome.

Thanks and regards.

Christophe Lefebvre
LexisNexis France

    7 replies

    1-Visitor
    May 25, 2011
    Christophe,
    The -es option is used to search your content including the content that may be defined in an entity. Try using the -m option to search for the markup that defines the entity.
    From help on find: -markup or (-m) indicates that the search string contains one or more tags or entities. Tags are indicated by surrounding angle brackets; an end tag contains a slash. Entities start with an ampersand (&) and end in a semicolon (;). For example, to search for the end of an italic tag pair you might type: find -m '</italic>'. To search for a copyright symbol, you might type: find -m '©'.

    -Bill
    1-Visitor
    May 25, 2011
    try find(' ',0x0530)

    I use that to find

    On Wed, May 25, 2011 at 1:39 AM, Lefebvre, Christophe (LNG-PAR) <
    christophe.lefebvre@lexisnexis.fr> wrote:

    > Hello Adepters,
    >
    > First of all, my apologies if I managed to post this thread on the forum
    > already. It looks like it won't work.
    >
    > I'm trying to use ACL to find and replace some numerically coded
    > entities by their named entity.
    > As an exemple : find " ", replace with " ".
    >
    > I tried the following things :
    > find -es / /
    > find -es / /
    > But none work. Which mean I get the message 'String not found'.
    >
    > The only thing I could manage was to cut and paste the caracter shown in
    > my edit window to the command line.
    > But I'm unable to do the same thing in my ACL file, because when I paste
    > that caracter in a text editor, I end with an '?'
    >
    > Any input or idea on how to handle those entity with ACL is welcome.
    >
    > Thanks and regards.
    >
    > Christophe Lefebvre
    > LexisNexis France
    >
    1-Visitor
    May 25, 2011
    Also, have you read writenonasciichar help? That might be of interest, too.

    1-Visitor
    May 25, 2011
    Thanks for your input

    @Bill Croshier

    I tried with different find options to no avail.
    I created a sample document with , and é
    I can find any my entities by name without problem. It's only that I can't find

    @unknown Nagai

    I guess I should have precised I'm working with the version 4.3 of Epic.
    I can't find any find( , ) command on that version. Is that some special package or a function in a later version ?

    I did some test with set writenonasciichar too.
    But it doesn't seem to change anything on the way and are saved. I only noticed a change for é which became é.

    Christophe Lefebvre

    -----Message d'origine-----
    De: Lefebvre, Christophe (LNG-PAR)
    Envoyé: mercredi 25 mai 2011 10:39
    À: -
    Objet: Troubles finding a numerically coded entity

    Hello Adepters,

    First of all, my apologies if I managed to post this thread on the forum already. It looks like it won't work.

    I'm trying to use ACL to find and replace some numerically coded entities by their named entity.
    As an exemple : find " ", replace with " ".

    I tried the following things :
    find -es / /
    find -es / /
    But none work. Which mean I get the message 'String not found'.

    The only thing I could manage was to cut and paste the caracter shown in my edit window to the command line.
    But I'm unable to do the same thing in my ACL file, because when I paste that caracter in a text editor, I end with an '?'

    Any input or idea on how to handle those entity with ACL is welcome.

    Thanks and regards.

    Christophe Lefebvre
    LexisNexis France
    18-Opal
    May 25, 2011
    Hi Christophe--

    If you want to construct a string to use with the find command in an ACL script, you might find the chr() function useful. It gives you the character corresponding to a numeric code point. For example, to search for "neé", you could do this:

    local $s = "ne" . chr(233); # 233 = e acute
    find "$s";

    In my test this found all instances, whether the character was specified as "é", "é", or the literal character "é".

    --Clay

    Clay Helberg
    Senior Consultant
    TerraXML
    1-Visitor
    May 25, 2011
    The use of chr() worked like a charm.
    Thank you very much.

    Christophe Lefebvre

    -----Message d'origine-----

    Hi Christophe--

    If you want to construct a string to use with the find command in an ACL script, you might find the chr() function useful. It gives you the character corresponding to a numeric code point. For example, to search for "neé", you could do this:

    local $s = "ne" . chr(233); # 233 = e acute
    find "$s";

    In my test this found all instances, whether the character was specified as "é", "é", or the literal character "é".

    --Clay

    Clay Helberg
    Senior Consultant
    TerraXML
    1-Visitor
    May 25, 2011
    Re: Epic 4.3: Oh! find() is a function in 5.x-land. I haven't had 4.x
    installed in a long time.

    On Wed, May 25, 2011 at 10:00 AM, Lefebvre, Christophe (LNG-PAR) <
    christophe.lefebvre@lexisnexis.fr> wrote:

    > Thanks for your input
    >
    > @Bill Croshier
    >
    > I tried with different find options to no avail.
    > I created a sample document with , and é
    > I can find any my entities by name without problem. It's only that
    > I can't find
    >
    > @unknown Nagai
    >
    > I guess I should have precised I'm working with the version 4.3 of Epic.
    > I can't find any find( , ) command on that version. Is that some special
    > package or a function in a later version ?
    >
    > I did some test with set writenonasciichar too.
    > But it doesn't seem to change anything on the way and are
    > saved. I only noticed a change for é which became é.
    >
    > Christophe Lefebvre
    >
    > -----Message d'origine-----
    > De : Lefebvre, Christophe (LNG-PAR)
    > Envoyé : mercredi 25 mai 2011 10:39
    > À : -
    > Objet : Troubles finding a numerically coded entity
    >
    > Hello Adepters,
    >
    > First of all, my apologies if I managed to post this thread on the forum
    > already. It looks like it won't work.
    >
    > I'm trying to use ACL to find and replace some numerically coded entities
    > by their named entity.
    > As an exemple : find " ", replace with " ".
    >
    > I tried the following things :
    > find -es / /
    > find -es / /
    > But none work. Which mean I get the message 'String not found'.
    >
    > The only thing I could manage was to cut and paste the caracter shown in my
    > edit window to the command line.
    > But I'm unable to do the same thing in my ACL file, because when I paste
    > that caracter in a text editor, I end with an '?'
    >
    > Any input or idea on how to handle those entity with ACL is welcome.
    >
    > Thanks and regards.
    >
    > Christophe Lefebvre
    > LexisNexis France
    >