I've done a search, but no success. I'd like to be able to export profile data into excell, for example. Has this been discussed before - please point me to a node.

Comments

mioip’s picture

I may be completely wrong, but you can export the MySQL fields (profile_fields and profile_values). I use the phpMyAdmin front end, where you can select different file types. I believe that most of those will associate with Excell.

dublin drupaller’s picture

Mioip is correct you can use phpMYadmin to export the profile fields. There are a few handy software tools that allows you to do that easier..such as navicat or my favourite webyog which has a free download that is like am extremely user friendly version of phpmyadmin - which I find to be a bit like trying to swat a fly with a missile.

There was a guy on here working on a labels.module that was tweaked to allow you to export user profile fields on a site I was working on into a CSV file. A CSV file is a comma delimited text file and it can be brought into excel.

I tweaked it with help from the labels.module developer for a drupal 4.5 site. Haven't tried it for 4.6 but I can email you a copy if you want to have a bash updating it for 4.6

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

dublin drupaller’s picture

Hiya..

Just tried it (profile fields export.module) with version 4.6 and it works.

It's a really basic module that allows you to:

(a) create customisable export templates that can be re-used.

(b) for each template you can choose which profile fields are exported.

(c) you can specify which ROLES are included in the export.

(d) exports your template to a CSV file (comma seperated file) that you can import into mostly anything, such as Excel.

I've added it to my folder in the drupal CVS sandbox
Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

picturesque’s picture

What a great contribution! The only issue I have is that the download link adds in the file location for the file. Example: I get "http://sitename.org/?q=/usr/home/epeak/www/htdocs/User_Addresses_2.csv" and it should be "http://sitename.org/User_Addresses_2.csv". I reviewed the module to see where to edit it, but couldn't see where it was grabbing this extra info.

larryjhs’s picture

L

dublin drupaller’s picture

No worries Larry..hope it's of use.

I was thinking afterwards that it might be useful as an add-on to the profile.module..e.g. as an extra TAB so users can export user profile data easily and simply.

Then again, maybe not. I might titdy up what I've got and suggest it as a patch.

Let me know if you have any hassles with the sandbox version. It works fine for me in drupal 4.6. but it was clubbed together for myself rather than for distribution.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

mleicester’s picture

I've rolled a patch for dub's module that takes advantage of Drupal's file permissions to protect the files generated by this export process from any users without the "download export" permission. Also, in addition to profile fields, users with "define export" permission may choose from the built in user fields (uid, username, email address, created, changed).

Anyone interested? Mr Dub., may I commit it to your sandbox?

nikle’s picture

This would be great, would you be able to post it somewhere?

dublin drupaller’s picture

Hi ordinary fool..

Sorry but i only just noticed this..feel free to add it to my sandbox, or if you don't have access, just email it to me and I can plop it in there.

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

dublin drupaller’s picture

Hi ordinary fool...

I had an idea for the export.module that might be of value to others, but, never had the time to look into..and that is:

(a) instead of it just being a profile_export.module it's a drupal_export.module.

(b) where users can create templates in a similar, simple way to the way it allows you to export user profiles, to export nodes.

(c) instead of the profile_fields the site admin chooses to export..they choose categories to include in the export.

(d) instead of USER ROLES the site admin chooses to be included in the export, they can use some other criteria..

Do you think that would be useful?

Dub

Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate

muzza’s picture

Hi Larry,

If you really need to write to an Excel spreadsheet then you could perhaps pipe your input into a Perl/CGI script that uses the Perl module below:

http://search.cpan.org/~jmcnamara/Spreadsheet-WriteExcel-2.15/

I have used this module to automatically export database extracts into excel sheets via a Unix cron job and it works well.

Regards

Murray