| || |
Output file at end of script - unable2 view as CSV
Thanks in advance for reading this lengthy post - I am also attaching the .txt file that is created at the end of the script.
I need help to be able to view the CSV file written by QTP at end of script for each record in several columns - currently it is displaying in several rows for one record/iteration that is completed.
I am trying to write to a csv file at the end of each iteration in an append mode instead of exporting the data table at the end of the test for 2 reasons -
1) So that if the script fails and I had to stop it I at least have output record of the one's that were successfull
2) This way only one output file will be appended for each successfull iteration so I have summary of all that I ran at any point of time.
In order to do this I have added Writeline function that I have got from this forum however when I view the output file that is created I am unable to view as I would for a data table.
Here is line I am using to write to csv file -
FWriteLineToFile((DataTable("InsuredName", dtGlobalSheet) & "," & DataTable("StreetAddr", dtGlobalSheet) & "," & strYesPossibleMatch & "," & DataTable("EffectDate", dtGlobalSheet) & "," & DataTable("BCC_Selected", dtGlobalSheet) & "," & DataTable("Customer_Number", dtGlobalSheet) & "," & DataTable("Quote_Num", dtGlobalSheet) & "," & DataTable("Quote_Status", dtGlobalSheet)))
For Ex: This is how it displays in several rows for one record instead of one row with several columns when I open the CSV- See the attached csv file
March24 QTPbz,5891 W Main St,,3/31/2009,Clothing or Wearing Apparel Distributors - Including Manufacturers Rep~219,
Date Quoted: 03/25/2009
03/31/2009 to 03/31/2010
,BOU1059813-00,Ready to Submit3/31/2009 - 3/31/2010$657.00
3/25/2009 March24 QTPh,5892 W Main St,,3/31/2009,Clothing or Wearing Apparel Stores - Children's and Infants Wear~1278,
It should display as below as it is doing when data table is exported at the end of test with several columns for each record/iteration)
March24 QTPbz 5891 W Main St Milwaukee Wisconsin 53214 1 3/31/2009 Clothing or Wearing Apparel Distributors $25,000 Noncombustible 4000 2005 3 300000 8 $300,000 200000 Semi-Annually 2000 Clothing or Wearing Apparel Distributors - Including Manufacturers Rep~219 5891 W Main St,Milwaukee,53214-,WI,MILWAUKEE Ready to Submit BOU1059813-00
Re: Output file at end of script - unable2 view as CSV
Can anyone please help me with this one?