• Development,  Tech Tips

    Quick Script: Convert a CSV file to a SQLite database file

    Updated on October 4, 2025 to detect INTEGER/REAL/TEXT column types.

    Here’s a quick bash script to convert a .csv file into a .sqlite file so you can query your CSV data in tools like TablePlus.

    The file size is only slightly larger than the original CSV, and you can share it (it’s just a file!).

    Just create the file csv-to-sqlite  somewhere in your PATH and chmod +x csv-to-sqlite  to make it executable.

    As a side note, you can use something like dsq to query a csv file. I’ve stopped using that for this particular task.

  • Development

    Modifying Rows During a Drupal 8 CSV Migration

    Migrate Source CSV is currently the source plugin of choice for doing a CSV-to-Drupal migration with the Migrate API in Drupal 8. In this post I will demonstrate how to manipulate the CSV data in realtime during the migrate:import operation. You can think of this as the equivalent to prepareRow() that you have seen elsewhere, like my blog post Extending the Migrate Plus JSON Parser in Drupal 8.

    Please make sure you have a working migration before you begin; it’ll make things easier to troubleshoot if you know you had a good starting point.