Question
· Apr 12, 2017

How to import Exel files into Cache

I need to import xlsx file into Cache. Could you prompt me which tools I can use for it. Thanks

Discussion (2)0
Log in or sign up to continue

Hi,

You can make a vbscript file (.vbs) with the script below and then run that to first convert your xls file to tab delimited.

If you wish to save as coma delimited you could also use ( oBook.SaveAs WScript.Arguments.Item(1), 6 ) instead of (oBook.SaveAs WScript.Arguments.Item(1), -4158) in the script below. 

I usually execute the vbs using $zf(-2,"scriptfilename.vbs"  "filetoconvert.xls" "ouptutfile.txt")

Then you can work with the resulting file.  Hope this helps.

============================

if WScript.Arguments.Count < 2 Then
    WScript.Echo "Error! Please specify the source path and the destination. Usage: XlsToCsv SourcePath.xls Destination.csv"
    Wscript.Quit
End If
Dim oExcel
Set oExcel = CreateObject("Excel.Application")
Dim oBook
Set oBook = oExcel.Workbooks.Open(Wscript.Arguments.Item(0))
oBook.SaveAs WScript.Arguments.Item(1), -4158
oBook.Close False
oExcel.Quit
WScript.Echo "Done"

===========================

Regards

Anil