[Isis-users] Fw: Splitting a Field
Egbert De Smet
egbert.desmet at uantwerpen.be
Wed Oct 27 13:28:44 CEST 2021
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%7C98ba8bae533f40bbcb5b08d9993a7bd6%7C792e08fb2d544a8eaf72202548136ef6%7C0%7C0%7C637709298896306277%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&sdata=JI8W37pPMkwjtn9NeY6jOCv%2B8lBSnHCkMlYK6rzBYVk%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/20211027/c067bd3b/attachment.html>
More information about the isis-users
mailing list