How to Split away Unwanted Characters from a String
Task description
The following Excel sheet has a column whose values consist of letters and numbers:
The task is to remove characters in each cell value and to retain the number only, and put the results in column C, as shown below:
Directions:
1. Start esProc and create a new program cellset.
Download esProc installation package and free DSK edition license HERE. You will be prompted to load the license file when you run esProc for the first time.
2. Open the above to-be-processed Excel file.
3. Select area A1:A10 and press Ctrl+C to copy data.
4. Then return back to esProc, select cell A1 and press Ctrl+V to paste data from the clipboard to A1. Make sure that the caret is placed above A1 in its editing status during the pasting. Here’s the cellset with data pasted from Excel:
5. Now write script to implement the specific computing rule, as shown below:
Here we list the script again and explain it line by line:
A |
B |
|
1 |
……(Data pasted from Excel) |
|
2 |
=A1.import@i() |
|
3 |
=A2.(~.words@d().concat()) |
A2 Since the to-be-processed data is a single column, we use @i option in import() function to return a sequence directly.
A3 Get the number in each row and, since the number forms one element only, return the numbers as a string using concate() function.
6. Execute the script. You can view the final result by clicking A3 after execution is finished:
7. Click the icon highlighted by the circle to paste the result to clipboard.
8. Back to Excel and select C1 to past the result in.
【Reference】 data.zip
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/
Chinese version