Resource icon

String Manipulation in loadrunner Using Strtok

  • perf-test.com need your contributions to build up a strong repository of performance engineering resources.

admin

Administrator
Staff member
Aug 13, 2014
137
3
18
www.speforums.com
admin submitted a new resource:

String Manipulation in loadrunner Using Strtok - Breaking strings into multiple parts separated by delimiter

Example 1: Breaking the string into multiple parts as specified by a delimiter. See the following example where we are breaking the string by a delimiter ":"

Code:
Action()
{
   
    char str[80] = "We love: SPEForums.com";
       const char s[2] = ":";
       char *token;
   
       /* get the first token */
       token = (char *)strtok(str, s);
       lr_output_message("The first output is %s", token);
   
       /* walk through other tokens */
       while( token != NULL )
   {...

Read more about this resource...
 
Hi,

I would like to know how to use string token in the below example. I tried to split using comma(,) and then replaced double quotes. But I need to save all the values in a seperate parameter like Value1, Value2, ... etc till end of the string.

"7159742","","1716676405","1716676405","Error in getCommitment Service: Unable to connect ","AL","92763","REF","P","01253","2016-08-03T00:00:00.000Z","ORI","DES","ORI","DES","2016-08-02T00:00:00.000Z","","","","IPF","","AOG","999999","USD","5500","162.57","","139","COUNTRY","304","304","427.79","100.91","15.625","1","ADMIN_REVIEW_QUEUE","ADMIN_REVIEW_QUEUE","RMMEM","Error in getCommitment Service: Unable to connect to any MIG service group :","UNPROCESSED","","","rmadmin","<anonymous>","15-Jun-2017 1:35:12","ACCEPT_REJECT_REFER","1","N","SYSTEM","FRA","",""

Kindly help.
Thanks in advance.

Regards
Saranya K