How to combine "|" character in run () command in powerbuilder in order to read an txt file as metad

Posted by sgian76 on Stack Overflow See other posts from Stack Overflow or by sgian76
Published on 2010-03-31T11:03:54Z Indexed on 2010/03/31 11:43 UTC
Read the original article Hit count: 210

Filed under:
|
|

Could you please tell me how to use "pdftk mypdf.pdf dump data | findstr NumberOfPages in powerbuilder run command and save this metadata in a file by using the following code like this:

string ls_runinput, ls_outputfile

ls_outputfile = "c:\test.exe"
ls_runinput = "c:\pdftk\pdftk.exe mypdf.pdf dump_data | findstr NumberOfPages >"+ls_outputfile 
Run(ls_runinput,Minimized!)

li_fileopen = FileOpen(ls_outputfile ,TextMode!, Read!, Shared!)

The problem is that Run command is executed, the file is created, but fileopen return -1 ? Is it maybe that run cannot recognize the "|" character? What should you propose me to write the right code? Iam using powerbuilder 10.5.2 , Thanks very much in advance

© Stack Overflow or respective owner

Related posts about pipe

Related posts about run