Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Need to compare two text files - ignoring some text
#1
Not Solved
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.
Reply
#2
Not Solved
Guys I'll really appreciate for any help.
Thanks.

Hi @Saket,
Really looking for your help.
Reply
#3
Not Solved
Hi,
For text file comparrision ....
Just a suggestion.....Upload the text file to Excel sheet by using macro or script.
Then get the cell value from 2nd row and compare.

let me know if this works.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Capture All text from webpage and copy it... mpatra 3 4,891 07-25-2018, 05:33 PM
Last Post: vimlesh
  LearnQuickTestPDF -does not work on just getting the text jloyzaga 0 1,173 02-10-2017, 10:59 AM
Last Post: jloyzaga
  How to edit a text in aParagraph shaan.mishra87@gmail.com 2 2,358 08-26-2016, 04:48 PM
Last Post: shaan.mishra87@gmail.com
  How to Verify Static Object Text which is changing Dynamically with Expected Result johnny77 0 3,176 06-25-2015, 11:32 AM
Last Post: johnny77
  Dynamic obj rep - get text in the class (html) marcio cravo moreira 0 2,037 05-26-2015, 06:58 PM
Last Post: marcio cravo moreira

Forum Jump:


Users browsing this thread: 1 Guest(s)