Get Common Words of Comma-separated Word Strings
Problem description & analysis
Below is Excel file words.xlsx:
hello,how,are,you,today |
hello,I,am,doing,good,and,you |
We are trying to get the common words of the two comma-separated word strings. Below is the expected result:
hello,you
Solution
Write the following script p1.dfx in esProc:
A |
|
1 |
=file("words.xlsx").xlsopen() |
2 |
=A1.xlscell("A1").split@c() |
3 |
=A1.xlscell("A2").split@c() |
4 |
=A2^A3 |
Explanation:
A1 Read data from the Excel file and return as an Excel object.
A2 Read value of cell A1 in the Excel file and split it into a sequence by comma.
A2 Read value of cell A2 in the Excel file and split it into a sequence by comma.
A4 Calculate the intersection of A2 and A3.
Read How to Call an SPL Script in Java to learn about the method of integrating a SPL script into a Java program.
SPL Official Website 👉 https://www.scudata.com
SPL Feedback and Help 👉 https://www.reddit.com/r/esProc_Desktop/
SPL Learning Material 👉 https://c.scudata.com
Discord 👉 https://discord.gg/cFTcUNs7
Youtube 👉 https://www.youtube.com/@esProcDesktop
Linkedin Group 👉 https://www.linkedin.com/groups/14419406/