Example module for Drupal which imports a CSV file (then does nothing with it)
PHP
Switch branches/tags
Nothing to show
Clone or download
Latest commit c2323b6 Apr 12, 2017
Permalink
Failed to load latest commit information.
src/Form
README.md Update README Apr 11, 2017
csvimport.batch.inc Move batch code to dedicated *.inc file Apr 11, 2017
csvimport.info.yml Upgrade info file Mar 28, 2017
csvimport.routing.yml Add route Mar 28, 2017
example.csv Adding an example.csv for imports. Jul 8, 2010

README.md

Drupal 8 Batch Process CSV Import

This is an example module!

  • Demonstrates how to use file upload and Batch API to import a CSV file.
  • The batch iterates through each line of the CSV (except the first) and does ... nothing, except for filling the progress bar.
  • Sample code to import CSV to node included.
  • In the end it outputs a new CSV file containing all lines that were not imported due to malformation (if any).

The basic idea is that if you're writing a CSV importer for Drupal, maybe you can start here and save a lot of time.