09-06-2012, 08:26 PM
First of all,
Thank you very much for your awesome effort.
I am not from programming background and totally new to VBscript. For some reasons, I have to do a this scripting task at office.
I want to use it with Quick Test Professional 11.
I have gone through many posts here as well on other forums but not able to find the required information.
Ok so here's what I need to do:
I have to compare two text files and write the difference in third file.
Both the files have almost same content aprt from some field, ie: Date, Order no and so on.
For example, File-1 has Date: 00/11/1234 and Order no: 1111 and File-2 has Date: 11/00/6789 and Order no: 2222
So is there any way that I can ignore these fields and its value?
Is there any way that I can create ignore list which I can add and which will be used during comparison and will skip the fields during comparison?
So my difference file will not have these difference as these values will always be different.
And so I can get the all other differences in my result file.
For your reference, here is the sample files.
So far I have compared both the files but in a simplest way, I don't know how to ignore the fields.
I want to make these task as a function so that I can use it in my function library.
File-1
Date: 00/11/1234 / Order no: 1111
Price 1: $1111.00
Price 2: $2222.00
Price 3: $1234.00
ABC def GHI kjl 1111
Order no: 1111
Term: 2-Year
Date: 00/11/1234
File-2
Date: 11/00/6789 and Order no: 2222
Price 1: $1111.00
Price 2: $2222.00
Price 3: $5678.00
ABC def GHI kjl 1111
Order no: 2222
Term: 3-Year
Date: 11/00/6789
Result file should disply:
Differences:
File-1 Line 4: Price 3: $1234.00
File-2 Line 4: Price 3: $5678.00
File-1 Line 7: Term: 2-Year
File-2 Line 7: Term: 3-Year
Thank you very much in advance.
Thank you very much for your awesome effort.
I am not from programming background and totally new to VBscript. For some reasons, I have to do a this scripting task at office.
I want to use it with Quick Test Professional 11.
I have gone through many posts here as well on other forums but not able to find the required information.
Ok so here's what I need to do:
I have to compare two text files and write the difference in third file.
Both the files have almost same content aprt from some field, ie: Date, Order no and so on.
For example, File-1 has Date: 00/11/1234 and Order no: 1111 and File-2 has Date: 11/00/6789 and Order no: 2222
So is there any way that I can ignore these fields and its value?
Is there any way that I can create ignore list which I can add and which will be used during comparison and will skip the fields during comparison?
So my difference file will not have these difference as these values will always be different.
And so I can get the all other differences in my result file.
For your reference, here is the sample files.
So far I have compared both the files but in a simplest way, I don't know how to ignore the fields.
I want to make these task as a function so that I can use it in my function library.
File-1
Date: 00/11/1234 / Order no: 1111
Price 1: $1111.00
Price 2: $2222.00
Price 3: $1234.00
ABC def GHI kjl 1111
Order no: 1111
Term: 2-Year
Date: 00/11/1234
File-2
Date: 11/00/6789 and Order no: 2222
Price 1: $1111.00
Price 2: $2222.00
Price 3: $5678.00
ABC def GHI kjl 1111
Order no: 2222
Term: 3-Year
Date: 11/00/6789
Result file should disply:
Differences:
File-1 Line 4: Price 3: $1234.00
File-2 Line 4: Price 3: $5678.00
File-1 Line 7: Term: 2-Year
File-2 Line 7: Term: 3-Year
Thank you very much in advance.