01-07-2013 08:08 AM
Hi
I have almost written a NIRG Type to NI-TestStand's old XML-Reportformat.
At the moment there is "simple" Challange. In my XML reportfile there is a leading Whitespace inside a StepId-tag.
<StepId> ID#:rLdC0wzTCEmL7Hz/UyvgLD</StepId>
Is it possible to place a regular expression to getrid of it ?
At the moment i have modified the requirement inside Teststand-type with Identifier Format:" \1", this works but
of course the external link to the TestStand-Step fail....
Regards
Juergen
Solved! Go to Solution.
01-08-2013 07:20 AM
Dear Mr Juergen,
Can you explain us where is exactly the problem and where is the files to reproduce or Test your Requirement?
What do you mean with the external Link to Teststand fail?
Thanks.
Best Regards
01-08-2013 08:18 AM
Hi Kais,
I try to explain it more abstract.
Inside TestStand there is a Step "abc" with StepId: "ID_HelloWorld"
When you run the stuff TestStand will generate a Xml-Report where this StepId is " ID_HelloWorld" ! Unfortunately there is always a leading white space on all Reports StepIDs.
Now lets go to NIRG.
If you like to analyse TS-SequnceFile and TS-Report you have link them. This will fail here, because the strings do not match.
Desired behaviour is to get rid of the leading WS in report type (See upper screenshot). So NIRG stores the ID inside without the WS. Now you should be able to link to the TS.
Workround: You are able to add the WS before itis stored in NIRG TS-SequenceType (NOT the report!! one) Now linking will work, too
But: There is nice feature in NIRG!! If you double click a step in NIRG, TS will be launched and jumps to this step in the sequencefile.
this will never work because my called step has a leading ws now.
Now i need to now: Is there a possibility with regex to remove WS before they are stored as "T"arget.
Regards
Juergen
01-09-2013 02:23 AM
Juergen,
afaik, NIRG uses "regular expressions". So it should be possible to use wildcards to "exclude/introduce" certain symbols. Without having performed any test, i cannot state the exact symbol for wildcard "exactly one character", it is most likely '.' (see here).
Another question which comes to my mind:
Why is the white space part of the StepID at all? It sounds like it is coming from the report generation, which can be modified. Depending on the way of reporting, you can change the string generation as whole or simply catch the string before written to XML and Search/Replace the string "StepID: " with "StepID:" (first got the white space after ':').
hope this helps,
Norbert
01-09-2013 03:29 AM
HI Norbert,
Thanks for replying.
According to the documentation it should be possible. In fact in my workaround i am adding a sign to the idstring. this done in the
identifer format by " \1". So the solution should be found in this edit control. Everytime when i am placing a regex string there it will be pre-added
to the id. Only \1 will place my Id. I do not really know how to place a regex there. And how it is managed internally. This could only explain the developer.
I agree. If there is noway to getrid of the WS. I will delete it the reportgenerator of course.
but were are using this generator for more than ten years now in the productionfield and development.
I do not know the total number of reports, it must be HUGE!
I think you can imagine that i am not amoused to change the generator.
Maybe you can talk to the developer to get some internal details of the "Indentifier Format".
Thanks und
Viele Grüsse vom Bodensee nach München
Jürgen
01-10-2013 02:09 AM
Hi,
My understanding is that you want to trim the first white space of the stepID if so, you can try "^[ \t]+". It is searching for the WS in the head of the content and replace with nothing.
If it doesn't match your requirement, please let me know.
Regards,
HaiJun
01-11-2013 01:54 AM - edited 01-11-2013 01:57 AM
Hi
I have found the solution "(\S.*)" to trim ws. Infact this sounds very easy. The most important thing is that the breakets "()" were
pleaced for grouping! without them NOTHING is working. the \1 in the Indentifier format is optional here. You need it if you have placed more
than one group.
Regards
Juergen