How to compare two csv files

243 views
Skip to first unread message

suman ch

unread,
Mar 7, 2012, 12:03:53 AM3/7/12
to mercu...@googlegroups.com
Hi Friends,

My scenario is to compare two csv files.

I am awareof doing one way by using filesystemobject and get the all the content using Readall method. But I am looking for a column by column comparison, if any column is missing i have to report it.

Any suggestions?

Regards,
Suman CH

Kunal

unread,
Mar 9, 2012, 1:24:19 AM3/9/12
to QTP - HP Quick Test Professional - Automated Software Testing
1. Open CSV file into XLS
2. Import XLS file into QTP Datatable
3. read value row-column wise & do comparison, if there is any
mismatch, write it in datatable
4. At the end of execution, export QTP datatable on local drive.

Cheers,
A B
Blog - www.automation.lifegoeasy.com
www.lifegoeasy.com

santhosh Ganji

unread,
Mar 9, 2012, 1:54:44 AM3/9/12
to mercu...@googlegroups.com
You can use split() function and compare the values....

--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to Mercu...@googlegroups.com
To unsubscribe from this group, send email to
MercuryQTP+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en



--
Thanks and Reagards
Santhosh G
+918007850250


Anish Pillai

unread,
Mar 10, 2012, 2:09:20 AM3/10/12
to mercu...@googlegroups.com
Hi Suman,

This can be done using two methods -

1) Importing the xls values in DataTable and then using the DataTable functions to compare the column values.

2) Using Excel COM to access the excel's in built methods to compare the excel columns.


Cheers,
a n i s h

[QTP - Automation Repository]

[Get New Posts in your Inbox]

--
AR

meera sagar

unread,
Mar 18, 2012, 1:09:57 AM3/18/12
to mercu...@googlegroups.com
Hi friends
in one interview i faced the question 
1)how to call one vbscipt file from another vbscript file

plz ans for the above query

thank u 
sagar

Shalabh Dixit

unread,
Mar 19, 2012, 1:54:46 AM3/19/12
to mercu...@googlegroups.com
Try this..

Set objShell = CreateObject("WScript.Shell")
objShell.run("cscript C:\scripts\demo.vbs")


Regards
Shalabh Dixit
My QTP Blog



--
Reply all
Reply to author
Forward
0 new messages