I’ve been working on a client’s site this week, trying to pull some data out of one of their forms. Unfortuately the abilty to just download the data through the form module wasn’t working.
After tinkering with MySQL and PHP to grab the data JUST the way I wanted it, it hit me. A solution so simple, so quick, that I was amazed I hand’t though about it earlier.
Here’s what I did:
- Went into Drupal’s admin interface.
- Clicked on “Webforms” under “Content Management”
- Viewed the results of the form I wanted in table format.
- Viewed source of the page and copied it into Textmate
- Removed any source that wasn’t part of the table
- Systematically found and replaced all table tags. <tr>’s and </tr>’s were removed completely. <td> was replaced with double quotes and </td> was replaced by double quotes, a comma, and a space.
Voila. Instant CSV file.
It‘s quite in here! Why not leave a response?