ask_j
07-Sep-2010, 08:27 PM
Hi,
I have a requirement where we read entire database and create text files called .kbs files. Whenever we change the generator we have to generate and compare files generated by old vs new generator. My current issue is that I am using vendor API in the old generator which is not producing consistent result, meaning sometimes more white spaces, sometimes some lines has CxMExp and other times it has CxExp etc. But both works when files loaded on the server. There are many more issues for which I am able to write rules etc. For example I am able to ignore the entire line if a particular text found etc.
I read lot of posts to ignore white spaces and I created a new file format and created few rules to ignore certain lines. My question is how can I ignore the difference between CxMExp and CxExp? I tried creating a Basic rule as RegEx, saying anything matching Cx*Exp should be ignored. Its not working (I unchecked the box when running using rules).
Also I am facing two more issues. First one is that there are some lines which are coming in different order. Meaning for example I want to write a rule saying if a line starts with "Import" and other characters in the line are present at some other line number in the second file then ignore this difference.
for example file 1
<Import abc=dbc1.txt>
<Import abc=dbc2.txt>
<Import abc=dbc3.txt>
<Import abc=dbc4.txt>
<Parameter ab [1,3,4,5] >
<Parameter db [5,4,6,8] >
file 2
<Import abc=dbc1.txt>
<Import abc=dbc4.txt>
<Import abc=dbc2.txt>
<Import abc=dbc3.txt>
<Parameter ab [1,3,4,5] >
<Parameter db [5,4,6,8] >
So in this example I want to say that file 1 and 2 are equal
Secondly I want to state a rule to compare following two files and still want them equal. Both the files can contain more that these kind of situations and also many other lines with matching/un-matching characters.
file 1
<com "abc" "model" "abc" [id="1", name="t1", dec="help wanted", seqNo="100"] >
file 2
<com "abc" "model" "abc" [dec="help wanted", name="t1", id="1", seqNo="100"] >
Please help..
I have a requirement where we read entire database and create text files called .kbs files. Whenever we change the generator we have to generate and compare files generated by old vs new generator. My current issue is that I am using vendor API in the old generator which is not producing consistent result, meaning sometimes more white spaces, sometimes some lines has CxMExp and other times it has CxExp etc. But both works when files loaded on the server. There are many more issues for which I am able to write rules etc. For example I am able to ignore the entire line if a particular text found etc.
I read lot of posts to ignore white spaces and I created a new file format and created few rules to ignore certain lines. My question is how can I ignore the difference between CxMExp and CxExp? I tried creating a Basic rule as RegEx, saying anything matching Cx*Exp should be ignored. Its not working (I unchecked the box when running using rules).
Also I am facing two more issues. First one is that there are some lines which are coming in different order. Meaning for example I want to write a rule saying if a line starts with "Import" and other characters in the line are present at some other line number in the second file then ignore this difference.
for example file 1
<Import abc=dbc1.txt>
<Import abc=dbc2.txt>
<Import abc=dbc3.txt>
<Import abc=dbc4.txt>
<Parameter ab [1,3,4,5] >
<Parameter db [5,4,6,8] >
file 2
<Import abc=dbc1.txt>
<Import abc=dbc4.txt>
<Import abc=dbc2.txt>
<Import abc=dbc3.txt>
<Parameter ab [1,3,4,5] >
<Parameter db [5,4,6,8] >
So in this example I want to say that file 1 and 2 are equal
Secondly I want to state a rule to compare following two files and still want them equal. Both the files can contain more that these kind of situations and also many other lines with matching/un-matching characters.
file 1
<com "abc" "model" "abc" [id="1", name="t1", dec="help wanted", seqNo="100"] >
file 2
<com "abc" "model" "abc" [dec="help wanted", name="t1", id="1", seqNo="100"] >
Please help..