Highlighted
Absent Member.
Absent Member.
178 views

Write output into a file

Jump to solution
Hi,

Is there a way to output the values that are in my output parameters into a data file?

I am outputting the PO Numbers in my script, and i want them to be written in a data file for easy consolodation, instead of going through the output message one by one.


Thanks,
Melvin
0 Likes
1 Solution

Accepted Solutions
Highlighted
Frequent Contributor.. Frequent Contributor..
Frequent Contributor..

Re: Write output into a file

Jump to solution
Hi Melvin,

Use the below code and also find the same code attached in Vugen Script the code creates file with name sample.txt in c drive and writes a parameter value to it

/* Replace {param} with your PO Numebers param */

Action()

{


int i,fd;


char *cfilepath="c:\\sample.txt";


fd = fopen(cfilepath, "a");


fprintf(fd,"%s",lr_eval_string("{param}"));



fclose(fd);


}


You are resource limited only by your imagination

View solution in original post

2 Replies
Highlighted
Frequent Contributor.. Frequent Contributor..
Frequent Contributor..

Re: Write output into a file

Jump to solution
Hi Melvin,

Use the below code and also find the same code attached in Vugen Script the code creates file with name sample.txt in c drive and writes a parameter value to it

/* Replace {param} with your PO Numebers param */

Action()

{


int i,fd;


char *cfilepath="c:\\sample.txt";


fd = fopen(cfilepath, "a");


fprintf(fd,"%s",lr_eval_string("{param}"));



fclose(fd);


}


You are resource limited only by your imagination

View solution in original post

Highlighted
Absent Member.
Absent Member.

Re: Write output into a file

Jump to solution
Wow! It worked! Thanks a lot for your help! I just made some modications to make it work just how I like it to be:

fprintf(fd,"%s\n",lr_eval_string(PONum));

I added \n so that each PO Num is printed on a new line.

Thanks again for your help. I really appreciate it.


Melvin
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.