- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2022 02:39 AM
Hi All,
I need to extract the below words from the given fixed format(Sentence) and store it in a variable
LineWalk - RequestedFor(VIDYALAK@abc.com) - OpenedBy(MANOJBAN@abc.com)
Var A should contain LineWalk
Var B should contain VIDYALAK@abc.com
Var C should contain MANOJBAN@abc.com
Please help me how to extract the data.
Regards,
R Vidya Lakshmi
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2022 02:50 AM
Hello Vidya,
Please check with below script once in background script:
var sentenceValue = "LineWalk - RequestedFor(VIDYALAK@abc.com) - OpenedBy(MANOJBAN@abc.com)";
var sentenceArray = sentenceValue.split(" - ");
var variableA = sentenceArray[0];
var variableBValue = sentenceArray[1].split("(")[1];
var variableCValue = sentenceArray[2].split("(")[1];
var variableB = variableBValue.substring(0, variableBValue.length-1);
var variableC = variableCValue.substring(0, variableCValue.length-1);
gs.print(variableA);
gs.print(variableB);
gs.print(variableB);
If my answer helped you in any way then please do mark it as helpful. If it answered your question then please mark it correct and helpful.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2022 02:50 AM
Hello Vidya,
Please check with below script once in background script:
var sentenceValue = "LineWalk - RequestedFor(VIDYALAK@abc.com) - OpenedBy(MANOJBAN@abc.com)";
var sentenceArray = sentenceValue.split(" - ");
var variableA = sentenceArray[0];
var variableBValue = sentenceArray[1].split("(")[1];
var variableCValue = sentenceArray[2].split("(")[1];
var variableB = variableBValue.substring(0, variableBValue.length-1);
var variableC = variableCValue.substring(0, variableCValue.length-1);
gs.print(variableA);
gs.print(variableB);
gs.print(variableB);
If my answer helped you in any way then please do mark it as helpful. If it answered your question then please mark it correct and helpful.
Thanks