Hi all,
I know I can type a command in putty using the action - Key Sequence.
But this action doesn't seem to accept a command string with "{}" parameters such as awk command
For example, I want to type this command in putty.
utility_name MM_DD_YYYY 0 0 | awk '{print $11;}'
Manual type in Key Sequence and a variable, none of them accept a string containing "{}" characters.
How to send the command with these characters?
I found a workaround. For example, create text files and each file has one command line.
Thru recording, open one notepad with text file, and copy and paste it on Putty window.
It works but I don't think it's a good way since I have to maintain text files manually.
Any ideas?
how to make up Key Sequence with Data Driven?
Re: how to make up Key Sequence with Data Driven?
Have you tried escaping the {} characters using a backslash?
\{\}
Shortcuts usually aren't...
Re: how to make up Key Sequence with Data Driven?
It doesn't save a string either.
I tried like this:
utility_name 03_09_2016 | awk '\{ print $11; \}'
I tried like this:
utility_name 03_09_2016 | awk '\{ print $11; \}'
Re: how to make up Key Sequence with Data Driven?
Hi dontbeshy,
You could use the following line in a keysequence in order to achieve your intention.
I hope this helps.
Sincerely,
asdf
You could use the following line in a keysequence in order to achieve your intention.
Code: Select all
utility_name MM_DD_YYYY 0 0 | awk '{{print $11;}'
Sincerely,
asdf
Re: how to make up Key Sequence with Data Driven?
I found this link by chance.
http://www.ranorex.com/Documentation/Ra ... ress_8.htm
{ needs another { but } doesn't need another one.
Also I found out that " needs \ if we want to call this in code module.
For example,
In User Code,
Keyboard.Press(" my_utility 14_09_2016 0 0 | awk '{print "total: "$5;}' ");
Because of {, it should be like this
Keyboard.Press(" my_utility 14_09_2016 0 0 | awk '{{print "total: "$5;}' ");
But still build error because of " in the string. So it needs \ for "
Keyboard.Press(" my_utility 14_09_2016 0 0 | awk '{{print \"total: \"$5;}' ");
Then should be okay to build and run.
Thanks everyone.
http://www.ranorex.com/Documentation/Ra ... ress_8.htm
{ needs another { but } doesn't need another one.
Also I found out that " needs \ if we want to call this in code module.
For example,
In User Code,
Keyboard.Press(" my_utility 14_09_2016 0 0 | awk '{print "total: "$5;}' ");
Because of {, it should be like this
Keyboard.Press(" my_utility 14_09_2016 0 0 | awk '{{print "total: "$5;}' ");
But still build error because of " in the string. So it needs \ for "
Keyboard.Press(" my_utility 14_09_2016 0 0 | awk '{{print \"total: \"$5;}' ");
Then should be okay to build and run.
Thanks everyone.