Adagio
7 years agoFrequent Contributor
How to extract a string from between 2 other repeating strings
Hi,
This problem has been bothering me for sometime now. Could someone please help?
As shown in the snapshot below, I have to extract 0028441622 from this text on the picture. I'm able to read the whole text using the name mapping, but unable to write a logic which would extract the string from between iLPN: and iLPN
Any help would be appreciated!
Thank you
Abhi
Such tasks can usually be easy solved with the help of replace/split/join methods.
Here is your specific task solved in JScript:
var s = 'SOME TEXT\nItem Description:\nSOME OTHER TEXT\nINT:SOME TEXT AGAIN\niLPN:\n0028441622\niLPN:SOME TEXT AT THE END'; var iLPN = s.replace('\n', '').split('iLPN:')[1]; Log.Message(iLPN);