ASPL Programming ver 1.00
© 2024 Bassem W. Jamaleddine


13. 28
   split split set variables into set variables

 

logo

split a1 [a2 .. aN] trg

where a1 [a2 .. aN] trg are set variables.

split a1 [a2 .. aN] trg                 where a1 [a2 .. aN] trg are set variables

split`mtm~       a1 [a2 .. aN] trg

split/mtm~ a1 [a2 .. aN] trg

where a1 [a2 .. aN] trg are set variables

⑦ conso: default 15px split where a1 [a2 .. aN] trg are set variables.

⑦ conso13: split where a1 [a2 .. aN] trg are set variables.

⑦ conso17: split where a1 [a2 .. aN] trg are set variables.

⑦ typew: split where a1 [a2 .. aN] trg are set variables.

⑦ without anything split where a1 [a2 .. aN] trg are set variables.

This is pushed on the stack:

interset top of stack with address at one below top of stack and push result on the stack

① split

interset a1 [a2 .. aN] trg and push result on the stack

② split     a1 [a2 .. aN] trg

③ split a1 [a2 .. aN] trg

interset a1 [a2 .. aN] trg and store result in X and push result on the stack

④ X = split a1 [a2 .. aN] trg

just conso split where a1 [a2 .. aN] trg

split  setoid  1*t          ins:H_H_H  ous:H_H_H

●  Operator split split set variables into set variables

Use the split operator to split a set variable into its consituent labeling group.If the group labels follow a regulated syntax with a word suffix followed by digits then you can split .. see example 2 below.

see SECTION 13.30.1 [purge purges set variables grplb from a set variable]

lalala

see SECTION 13.30.1 [purge purges set variables grplb from a set variable]

lololo

 

split EXAMPLE1

TRASH TEMPLATE THAT NEEDS TO BE EDITED

The following example shows how to display the files in two directories that have the same content. These files may be located in different directories and may have different names.

 

split OPERATION1

TRASH TEMPLATE THAT NEEDS TO BE EDITED

①  aspl> a12 = f& a1 a2 
    (a12 is assigned the intersection of a1 a2)

②  aspl> display a12
    (print out a12)

       Figure spheres3d.png
full view

Image File

 -F- Fig. 13.28.1   [operation_17_split]
ASPL (C) 2024 Bassem Jamaleddine

③  aspl> v a12
    (view internals of set variable a12)

       code shebang resizable w.o. cross

(raw text)
1.    . #!/opt/ASPLv1.00/bin/aspl WS1 -tattler -verbose -gB 11111111 
      -extendedsimilarity -assignonce -nostrictld -jZ -noansi 
2.    . ;;#!/opt/ASPLv1.00/bin/aspl WS1 -tattler -verbose -gB 11111111 
      -extendedsimilarity -assignonce -nostrictld -logfile aspl-date.log -jZ 
3.    . ;;#!/opt/ASPLv1.00/bin/aspl WS1 -tattler -verbose -gB 11001100 
      -extendedsimilarity 
4.    . ;;#!/opt/ASPLv1.00/bin/aspl -script /opt/ASPLv1.00/junk/ex2.aspl  
      -tattler 
5.    . ;;#!/opt/ASPLv1.00/bin/aspl -wsdir /ffff/foo.as  -tattler
6.    . ;;#!/opt/ASPLv1.00/bin/aspl -wsname WS1 -tattler
7.    . 
8.    . ;;#!/opt/ASPLv1.00/bin/aspl WS1
9.    . 
10.   . ;;#!/opt/ASPLv1.00/bin/aspl -verbose WS1 
11.   . ;;#!/opt/ASPLv1.00/bin/aspl -verbose WS5 
12.   . ;;#!/opt/ASPLv1.00/bin/aspl WS5 -verbose                     WRONG 
13.   . 
14.   . 
15.   . ;;#!/opt/ASPLv1.00/bin/aspl -wsname WS5 -globalvar
16.   . 
17.   . ;; /opt/ASPLv1.00/ex1.aspl /tmp/aa1 /tmp/aa4
18.   . 
      ;;*********************************************************************** 
19.   . ;;   excurl.aspl
20.   . ;;
21.   . ;;   Using DEF
22.   . ;;   Using Curly Set Expression Demo
23.   . ;;
24.   . ;;   Copyright © 2020-2021 Bassem W. Jamaleddine
25.   . ;;   Copyright © 2021 Total Computing & Network Design, Inc.
26.   . ;;   All rights reserved.
27.   . ;;
28.   . 
      ;;*********************************************************************** 
29.   . 
30.   . attachlog +aspl-date.log
31.   . trace 1
32.   . load WS1
33.   . f& a1 a2 a3
34.   . endscript
35.   . 
36.   . load WS1
37.   . v
38.   . load WS5
39.   . v
40.   . endscript
41.   . 
42.   . ;; /opt/ASPLv1.00/ex1.aspl /tmp/TX/27238-tx.jar /tmp/TX/38141-tx.jar
43.   . 
44.   . ;;d1 = ggjar(jarfile,$1,calchksum,1,calentropy,1)
45.   . ;;d2 = ggjar(jarfile,$2,calchksum,1,calentropy,1)
46.   . ;;d1 = ggdir $1
47.   . ;;d2 = ggdir $2
48.   . 
49.   . sequencing lcs
50.   . f%U d1 d2
51.   . density d1 d2
52.   . sim d1 d2
53.   . endscript
54.   . 
55.   . 
56.   . ;;FN pp()
57.   . ;;FN pp3(a2,a3,a4)
58.   . 
59.   . displayoff
60.   . ;FN pp(); FN pp3(a2,a3,a4);v
61.   . #f& a2 a4;
62.   . 
63.   . def pp := a12 = f& a1 a2; a23 = f& a2 a3; a123 = f& a12 a23
64.   . def pp3 := x12 = f& %%1 %%2; x23 = f& %%2 %%3; x123 = f& x12 x23
65.   . 
66.   . endscript
67.   . 
68.   . ;; d1 = ggdir $SHELL:V1
69.   . ;; d2 = ggdir $SHELL:V2
70.   . ;; f%& d1 d2
71.   . ;; endscript
72.   . 
73.   . ;; aspl script
74.   . ;; script /opt/ASPLv1.00/script.aspl
75.   . 
76.   . load WS1
77.   . v
78.   . load WS5
79.   . v
80.   . 
81.   . endscript
82.   . 
83.   . 


                           Ticking Similarity With Predicates (see table)


_  the set element names are the file containment names 
ffl  the set element names are the file containment names 
f  the set element names are the named files 
c  the set element names are the checksums of the named files 
z  the set element names are the zsums of the named files 
fflz  the set element names are the file containment names AND their zsums 
dosi  the set element names are the document similarities of the named files 
h  the set element names are the entropies of the named files 
c  the set element names are the checksums of the named files 
fc  the set element names are the named files AND their checksums 
fflc  the set element names are the file containment names AND their checksums 
fflmtm  the set element names are the file containment names AND their modification time 
mtm  the set element names are the modification times of the named files 
fmtm  the set element names are the named files AND their modification times 
d  the set element names are the containment path of the named files 
dmtm  the set element names are the containment path AND the modification times of the named files 



       code in full shebang w./o cross

(raw text)
1.    . #!/opt/ASPLv1.00/bin/aspl WS1 -tattler -verbose -gB 11111111 
      -extendedsimilarity -assignonce -nostrictld -jZ -noansi 
2.    . ;;#!/opt/ASPLv1.00/bin/aspl WS1 -tattler -verbose -gB 11111111 
      -extendedsimilarity -assignonce -nostrictld -logfile aspl-date.log -jZ 
3.    . ;;#!/opt/ASPLv1.00/bin/aspl WS1 -tattler -verbose -gB 11001100 
      -extendedsimilarity 
4.    . ;;#!/opt/ASPLv1.00/bin/aspl -script /opt/ASPLv1.00/junk/ex2.aspl  
      -tattler 
5.    . ;;#!/opt/ASPLv1.00/bin/aspl -wsdir /ffff/foo.as  -tattler
6.    . ;;#!/opt/ASPLv1.00/bin/aspl -wsname WS1 -tattler
7.    . 
8.    . ;;#!/opt/ASPLv1.00/bin/aspl WS1
9.    . 
10.   . ;;#!/opt/ASPLv1.00/bin/aspl -verbose WS1 
11.   . ;;#!/opt/ASPLv1.00/bin/aspl -verbose WS5 
12.   . ;;#!/opt/ASPLv1.00/bin/aspl WS5 -verbose                     WRONG 
13.   . 
14.   . 
15.   . ;;#!/opt/ASPLv1.00/bin/aspl -wsname WS5 -globalvar
16.   . 
17.   . ;; /opt/ASPLv1.00/ex1.aspl /tmp/aa1 /tmp/aa4
18.   . 
      ;;*********************************************************************** 
19.   . ;;   excurl.aspl
20.   . ;;
21.   . ;;   Using DEF
22.   . ;;   Using Curly Set Expression Demo
23.   . ;;
24.   . ;;   Copyright © 2020-2021 Bassem W. Jamaleddine
25.   . ;;   Copyright © 2021 Total Computing & Network Design, Inc.
26.   . ;;   All rights reserved.
27.   . ;;
28.   . 
      ;;*********************************************************************** 
29.   . 
30.   . attachlog +aspl-date.log
31.   . trace 1
32.   . load WS1
33.   . f& a1 a2 a3
34.   . endscript
35.   . 
36.   . load WS1
37.   . v
38.   . load WS5
39.   . v
40.   . endscript
41.   . 
42.   . ;; /opt/ASPLv1.00/ex1.aspl /tmp/TX/27238-tx.jar /tmp/TX/38141-tx.jar
43.   . 
44.   . ;;d1 = ggjar(jarfile,$1,calchksum,1,calentropy,1)
45.   . ;;d2 = ggjar(jarfile,$2,calchksum,1,calentropy,1)
46.   . ;;d1 = ggdir $1
47.   . ;;d2 = ggdir $2
48.   . 
49.   . sequencing lcs
50.   . f%U d1 d2
51.   . density d1 d2
52.   . sim d1 d2
53.   . endscript
54.   . 
55.   . 
56.   . ;;FN pp()
57.   . ;;FN pp3(a2,a3,a4)
58.   . 
59.   . displayoff
60.   . ;FN pp(); FN pp3(a2,a3,a4);v
61.   . #f& a2 a4;
62.   . 
63.   . def pp := a12 = f& a1 a2; a23 = f& a2 a3; a123 = f& a12 a23
64.   . def pp3 := x12 = f& %%1 %%2; x23 = f& %%2 %%3; x123 = f& x12 x23
65.   . 
66.   . endscript
67.   . 
68.   . ;; d1 = ggdir $SHELL:V1
69.   . ;; d2 = ggdir $SHELL:V2
70.   . ;; f%& d1 d2
71.   . ;; endscript
72.   . 
73.   . ;; aspl script
74.   . ;; script /opt/ASPLv1.00/script.aspl
75.   . 
76.   . load WS1
77.   . v
78.   . load WS5
79.   . v
80.   . 
81.   . endscript
82.   . 
83.   . 

 

split EXAMPLE2

Use the split operator to split a variable into multiple variables according to their named group label. If the group label names are homogeneously named according to a predefined suffix then you can split them according to that suffix.

In this example we will harvest the processes started by a WebSphere startup script then split them into variables each named with the process label. Refer to workspace ENV123.

 

split OPERATION2

aspl> was6 = ggreapenvbypid(grp1,wa1,program,/opt/IBM/WebSphere/AppServer/bin/startServer.sh server1,onlychanged,1)

aspl> v

aspl> split was6 into p*

aspl> v