[Isis-users] Fw: Splitting a Field

Egbert De Smet egbert.desmet at uantwerpen.be
Thu Oct 28 11:59:54 CEST 2021


Hello,


it is difficult to check this as I don't have test-data in JISIS available. Using a reformatting FST is a good idea which I didn't think off myself...

Seeing that the same grammar can be used (e1, s1 etc.) as in the CISIS-procs is interesting also.

So if you think your results are o.k., I am sure they will be o.k. as it can easily be checked visually.


By the way, if you put the 'proc' I sent you in between brackets from line 2 on (so after the deletion of the existing field in the output record) to make it repeatable, my test on a record with 2 occurrences of the field shows it works perfectly well. So I can still do the process on your ISO2709 exported data, if you want.

If you have your JISIS-data then also exported as ISO2709 we could compare the output to make sure it is the same.


Egbert de Smet
Universiteit Antwerpen


________________________________
From: Amjad Ali Malik <amjadalimalik66 at hotmail.com>
Sent: Wednesday, October 27, 2021 6:37 PM
To: Egbert De Smet
Subject: Re: [Isis-users] Fw: Splitting a Field


CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

Dear Egbert & Ernesto,
Thank you for your response.
I have tested your solution but function returned fatal error, hence this code led me to solve the problem. I walked on your foot steps and succeeded in making a "reformatting fst" using your code. Now you check my solution weather this is correct or not.

Problem:  Tag v810, have data stored through circulation that is Repeatable, this data is stored as

Unformatted --> v810 = ^m253;13;2;Oct 2018^i13-10-2019

Required:
Formatted --> v810 = ^m253^v13^n2^dOct 2018^i13-10-2019

I used this reformatting fst to export data from JISIS, FST is as

<?xml version="1.0" encoding="UTF-8"?>
<fst storeRecordInIndex="1" makeCatchallField="1">
  <fstentry id="20" name="" technique="0">
    <pft>
<![CDATA[v20]]>
    </pft>
</fstentry>
  <fstentry id="800" name="" technique="0">
    <pft>
<![CDATA[(v800/)]]>
    </pft>
</fstentry>
  <fstentry id="810" name="" technique="0">
    <pft>
<![CDATA[(e1:=1, e2:=nocc(v810), while e1<=e2
(
                s1:=(s(v810[e1])),
                e3:=size(s1),
                e4:=1,
                s2:=(''),
                while e4<=e3
                (
                                if mid(s1;e4;1) : s(';') then
                                                if s2 : '^n' then s2:=(s2,'^d'),
                                                else
                                                                if s(s2) : '^v' then s2:=(s2,'^n'),
                                                                else  s2:=(s2,'^v'),
                                                                fi,
                                                fi,
                                else s2:=(s2,mid(s1;e4;1)),
                                fi,
                                e4:=e4+1,
                )
                s2/

                e1:=e1+1
))]]>
    </pft>
</fstentry>
</fst>

Please check my solution. I think that process returned me desired results but your authenticity will confirm validity.

Regards

Amjad Ali Malik
________________________________
From: isis-users <isis-users-bounces+amjadalimalik66=hotmail.com at iccisis.org> on behalf of Egbert De Smet <egbert.desmet at uantwerpen.be>
Sent: Wednesday, October 27, 2021 4:28 PM
To: Lista Isis <isis-users at iccisis.org>; spinaker at adinet.com.uy <spinaker at adinet.com.uy>
Subject: Re: [Isis-users] Fw: Splitting a Field


OK, it wasn't mentioned I think whether or not the v10 is repeatable.

I think you can put the whole proc-code just in between brackets ( and )  to make it work on a repeatable field, but I don't have test-data with such repeated field immediately ready. With the brackets it still works o.k. on a single field occurrence.


Egbert de Smet
Universiteit Antwerpen


________________________________
From: spinaker <spinaker at adinet.com.uy>
Sent: Wednesday, October 27, 2021 1:10 PM
To: Egbert De Smet; Lista Isis
Subject: Re: [Isis-users] Fw: Splitting a Field


CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.


Egbert

your solution could work, but there is  another problem to take care
that field v10 is repeatable
therefore the problem is to implement repeatable loops into repeatable fields

but this solution can be a begining
regard
Ernesto


El 27/10/2021 a las 3:47, Egbert De Smet escribió:

[forwarded]


Hi,


if you are prepared to apply the modifications in a terminal window, you could use a 'proc' parameter with the CISIS-executable 'mx'.

For both the WinISIS and the JISIS data you would first have to export them to an ISO-format, the resulting records can be exported in their turn to ISO again and then imported in either WinISIS or JISIS.


So, starting from an ISO2709 export of your data, in a terminal window you have to issue the following commands, with the mx-executable (available in the cgi-bin folder of ABCD or from other sources) available in the work-folder where you have the ISO-export named 'before.iso' :

mx iso=before iso create=before now -all

mx before proc=@replacesf.proc<mailto:proc=@replacesf.proc> create=after now -all

mx after iso=after.iso now -all


Then the file 'after.iso' is the result and these records can be imported into your database.


The actual trick is in the process (proc) which is executed by mx and listed here :

======
'd10',
     s1:=(s(v10)),
     e1:=size(s1),
     e2:=1,
     s2:=(''),
/* sequence of subfields : vdpk */
     while e2<=e1
     (
      if mid(s1,e2,1) : s(';') then
       if s2 : '^p' then s2:=(s2,'^k') else
        if s2 : '^d' then s2:=(s2,'^p') else
         if s(s2) : '^v' then s2:=(s2,'^d') else
          s2:=(s2,'^v'),
         fi,
        fi,
       fi,
      else s2:=(s2,mid(s1,e2,1)),
      fi,
     e2:=e2+1,
     )
   '<10>',s2,'</10>',
=====

Copy/paste this code into a file 'replacesf.proc' and put it in the same work-folder.
If you feel it being too complicated, send me the ISO-export of your data and I can do it (in fact in a few seconds time...).


Egbert de Smet
Universiteit Antwerpen


________________________________
From: Amjad Ali Malik <amjadalimalik66 at hotmail.com><mailto:amjadalimalik66 at hotmail.com>
Sent: Tuesday, October 26, 2021 5:27 PM
To: Egbert De Smet
Subject: Re: Splitting a Field

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

Dear Egbert,
The sequence of subfields is fixed, The ';' is need to be replaced with any subfield character(s) in an algorithm sequentially 1st, 2nd , 3rd..... & I am using Winisis & JISIS

Regards
________________________________
From: Egbert De Smet <egbert.desmet at uantwerpen.be><mailto:egbert.desmet at uantwerpen.be>
Sent: Tuesday, October 26, 2021 6:44 PM
To: Amjad Ali Malik <amjadalimalik66 at hotmail.com><mailto:amjadalimalik66 at hotmail.com>; isis-users at iccisis.org<mailto:isis-users at iccisis.org> <isis-users at iccisis.org><mailto:isis-users at iccisis.org>
Subject: Re: Splitting a Field


Hi,


the problem I see is how to do this if the sequence of subfields is not fixed : how do we know which ';' to replace by which subfield 'vdpk' ?

I can imagine it is possible if the sequence is fixed, but if it is not no way to do it. In principle in ISIS the sequence of subfields is not by definition fixed, e.g. ^b can come before ^a etc.

In ABCD there is in the FDT a column 'pre-literals' which is meant to match a separator in some input string to subfields. But again the sequence will need to be fixed.



Egbert de Smet
Universiteit Antwerpen


________________________________
From: isis-users <isis-users-bounces+egbert.desmet=ua.ac.be at iccisis.org><mailto:isis-users-bounces+egbert.desmet=ua.ac.be at iccisis.org> on behalf of Amjad Ali Malik <amjadalimalik66 at hotmail.com><mailto:amjadalimalik66 at hotmail.com>
Sent: Tuesday, October 26, 2021 3:25 PM
To: isis-users at iccisis.org<mailto:isis-users at iccisis.org>
Subject: [Isis-users] Splitting a Field

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

Dear Experts,

I want to split a field into subfields having data stored as

 Source --> v10 = ^m256;12;103;;^i10242020

Target --> v10 = ^m256^v12^d103^p^k^i10242020

How it will be accomplished.

Regards
Amjad Ali Malik



_______________________________________________
isis-users mailing list
isis-users at iccisis.org<mailto:isis-users at iccisis.org>
To manage your own subscription options go to: http://lists.iccisis.org/listinfo/isis-users<https://eur01.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.iccisis.org%2Flistinfo%2Fisis-users&data=04%7C01%7Cegbert.desmet%40uantwerpen.be%7C97fb0415786d4ae4a4ef08d999681e49%7C792e08fb2d544a8eaf72202548136ef6%7C0%7C0%7C637709494901434831%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C2000&sdata=8bd28lgLACW61bOdIE7aPnER21%2FF4FuC7Mueo2eY%2B4I%3D&reserved=0>
Or contact Henk Rutten: hlrutten at xs4all.nl<mailto:hlrutten at xs4all.nl>



--
  .^.                                .^.
  ( )                                ( )
  ===                                ===
 =[=]================================[=]=
  | |  Ernesto Spinak                | |
  | |  spinaker at adinet.com.uy<mailto:spinaker at adinet.com.uy>        | |
  | |  Montevideo, Uruguay           | |
  | |  tel/fax  (598) 2622-3352      | |
  | |  celular  (598) 99612238      | |
 =[=]================================[=]=
  ===                                ===
  ( )                                ( )
   V                                  V
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.iccisis.org/pipermail/isis-users/attachments/20211028/4959ea06/attachment.html>


More information about the isis-users mailing list