I need the following:

1. A simple form in which user selects a text file (spreadsheet nice to have)
2. The file will have rows. Each row would be comma delimited field
eg: 100,Dave,dave@dave.com
3. On submit, submit function will be called, submit function should do the following:
--> read each row from file
-----> for each row, split row into fields and insert to a table (You dont need to code this part, just dump it)

So I need 2 functions:

function bulk_import_form (&$form_state,$node,$content_node){
//form to select flat file, will have comma delimited strings
}

function bulk_import_form_submit (&$form_state,$node,$content_node){
//read the file
//loop thru each row
//split the fields of each row, and insert to db table
}

Please let me know your quote

Comments

niklp’s picture

You want a quote for a "function" of which the required content is about as clear as mud? Interesting. You haven't even said what it is you're importing, or where it should be going.

You also probably haven't used google, as there's most certainly modules out there which will import users, nodes AND taxonomy, albeit separately. Suggest you hit IRC and ask in the #drupal-support channel.