This topic is locked

Add column names to csv before import 'on the fly?'

1/13/2009 2:22:32 PM
PHPRunner General questions
J
joeedel author

Is it possible to write column names to a csv file right before it is imported? my csv looks like this when ftp'd from a small scale machine that records weights
3900 ,PEACHES,2

4020 ,PEACHES,3
and as I understand needs to have column headers like this for a successful import
Weight,Product,Type

3900,PEACHES,2

4020,PEACHES,3
how can I add static column headers to csv directly before import I was thinking the fputcsv command but am unsure?
Thanks,

joe

J
Jane 1/14/2009

Joe,
you need to add field names manually to the csv file.

In general you can import optional number of fields.