Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Syntax problem using Execute

I have trouble getting a syntax to work. I want to run sed, a stream/text editor, from the QlikView script and replace # with " in a text file.

I have tried a few different ways to get QlikView to do this. Like:

Execute c:\...\sed - i "s/#/\"/g" "filename.txt";

Execute cmd.exe /C c:\...\sed - i "s/#/\"/g" "filename.txt";

The peculiar thing is that if I try to replace by anything but " (chr(34)) it works fine and the command c:\...\sed - i "s/#/\"/g" "filename.txt" works perfect when using the command prompt.

Any ideas how to solve this?

FWIW I am currently running QV Version 10.009061.7 64-Bit

//Nils

1 Solution

Accepted Solutions
Not applicable
Author

Hi,

try to put your command in a file ".bat".

Then execute that.

C u,

Stefano

View solution in original post

2 Replies
Not applicable
Author

Hi,

try to put your command in a file ".bat".

Then execute that.

C u,

Stefano

Not applicable
Author

Thank you for the response. The .bat solution works perfectly. I did consider it before but didn't ponder over it enough to realize I could pass the filename to the bat-file as a parameter. Much faster and neater solution than the one I did implement.

//Nils

The new implementation looks like this:

qv script:

execute xxx.bat $(filename);

bat-file:

sed -i "s/#/\"/g" %1