View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Per Magnus L?vold Per Magnus L?vold is offline
external usenet poster
 
Posts: 1
Default How to create text file from selected excel data

Hi,
I'm trying to figure out how to create a plain text file based partly
on data from a excel sheet.

For this I beleive I must use a scripting language which can access
Excel data and create a txt file.
I'm working in a windows XP environment. So far, I've been wondering
if vbs (VB scipt) is the solution. I'm not very familiar with VB,
however, and am not sure how I should access Excel data.

I'll try to explain what I wish to do with a sort of pseudo-code:

BEGIN
myExcelSource = new ExcelReader(c:\excelData.xls)
destination = new textFile(c:\result.txt)
FOR (amount_lines_in_excel_sheet) {
destination.writeLine("INSERT INTO test_table (excel_data1,
....excel_dataX) VALUES (" || myExcelSource.col(X).row(Y) || ... ");")
END FOR
END

Could anybody tell me if vbs is capable of doing this, or if I perhaps
should look at another scripting language that is capable of this (or
similar)?

Regards, Per Magnus