Csv problem

Closed
Lcross - Oct 22, 2008 at 04:51 PM
 javent - Jan 22, 2009 at 05:40 PM
Hello,
i'm trying to do a macro that goes trough a table and copy the data in 1st row into a string and write in a csv file
but the table does not have always the same number of colums and i need it to check if next colum is blank or not.

then i need the same thing but to copy the data from the nr rows with data and for the nr of colums it detected

hope its not too confusing

i have a table with headers in the first row and data on the next rows but not the colums or the rows have a fixed nr and wath i need is some way to copy the data to a csv format (~ for fields indicator) first the headers (1 row) then the data

Can you help me ?
Related:

1 response

with ruby as well as other languages you can do something like:


require 'csv'
file = CSV.open("filename")
header = file.shift


then you can process the file and header as you like.
0