I'm writing a program to convert a .csv file into an Excel file in VBScript.
This is the portion of my .csv file (It has a header as well)
Report Title,Goods Performance Characteristics Report,,Report Title,Goods Performance Characteristics Report,,,,,,, Begin Date,8/7/2012,,,,,,,,,, Template Name,XXXX-Test-VVV-Two-Positions,,,,,,,,,, Total Productions,,,,,,,,,,,
,ID,Name,Product Description,Issue Date,Product Type,Weight (kg),Weight (lb),Price,Product volume, Profit,Total Value (000) ,315616102,Lux Honey,Body Wash,8/1/2012,C,0.06,0.06,93,793920,0,7455703038 ,579780206,Clear AntiDandruf,Shampoo,8/1/2012,C,0.06,0.06,60.5,1325980,2.05,8022179000 ,761713106,Loreal Divine,Face Crub,8/1/2012,F,0.12,0.12,46.52,3314780,5.07,15420356560
This is the updated VBScript code I wrote for the conversion.
Dim xlApp, workBook1, workBook2,aSheets, fileName, aInfo2,aInfo1,oExcel
Const XlPlatform = "xlWindows"
Const xlDelimited = 1
Const xlTextQualifierDoubleQuote = 1
Const xlTextFormat = 2
Const xlGeneralFormat = 1
Set oExcel = Sys.OleObject("Excel.Application")
Set xlApp = CreateObject("Excel.Application")
Set workBook1 = xlApp.ActiveWorkBook
Set workBook1 = xlApp.WorkBooks.OpenText("Y:\Personal Folders\XXXX\TestFile1.csv",XlPlatform, 1, xlDelimited, xlTextQualifierDoubleQuote, true, false, false, true, false, true, "CRLF", Array(Array (1,2),Array (2,2),Array (3,2),Array (4,1),Array (5,2),Array (6,1),Array (7,1),Array (8,1),Array (9,1),Array (10,1),Array (11,1)), true, false)
Set workBook1 = xlApp.ActiveWorkBook
xlApp.Visible = true
workBook1.Save "Y:\Personal Folders\XXXX\x.xlsx", xlNormal
workBook1.Close
But the data is not in a tabular form in the Excel file.I want to display the data in a tabular form.
Could anyone please help me to extract data based on the delimeters.I need the header part in the excel file as well.
Thanks in advance