Great plugin Daniel. Thanks for sharing it. It’s been really useful.
I wonder if you could help me. I am using the code below to get member info and one member custom field from certain member groups. My problem is that I am getting results from all member groups not just the pipe delimited selected group_ids.
{exp:csvee group_id="1|6|9" query="SELECT m.screen_name, m.username, m.group_id, m.join_date, d.m_field_id_1 FROM exp_members AS m LEFT JOIN exp_member_data AS d ON d.member_id = m.member_id" filename="ggp-subscribers-list.csv"}
Also do you know if its possible to format the display of m.join_date to read as a date rather than the amount of seconds from 1970, the start of the unix epoch, ala “1202917350”?
Thanks
Wondering if someone can help me out with the CSVee plugin.
I’ve added the following code to a blank template
{exp:csvee query="SELECT member_id, username, screen_name, email FROM exp_members"}
I’m presented with
The following tag has a syntax error: {exp:csvee} Please correct the syntax in your template.
What did I do incorrectly? Or, does this plugin not work with EE1.6.3?
In case someone’s trolling here with the same question posted by Brian M. earlier in this thread regarding multi-select fields in Freeform and export weirdness because each value is on a separate line, I came across that very thing today.
I checked in the Solspace forum, and someone did post an answer on how to fix it in Freeform. It’s very easy and it does work!
In mod.freeform.php search for this: (about line 850 in version 2.6.5)
// If the field is a multi-select field, then handle it as such.
if ( is_array( $val ) )
{
$val = implode( "\n", $val );
$data[$key] = $REGX->xss_clean($val);
}
...
The fix?
Replace $val = implode( “\n”, $val );
With $val = implode( “,”, $val );
That gives you a comma-separated list of your multiple values, which makes Excel very happy.
Hey
Great plugin, one of the best and just what I needed! Although, I’m having problems with the character encoding, but I’m not sure if it’s on Excels side.
Opening the .csv-file using a text editor, I get this
“14”,”1”,”23”,”Äpple”,”1”,”André”
resulting in this
14 1 23 Äpple 1 André
Somewhat tells me this might be caused by Excel (2008 version for Mac), but I thought I’d ask anyway 😊
Tnx /André
SOLVED: I renamed the file from .csv to .txt and then copied and pasted the contents into Excel. Worked great.
I’m trying to use CSVee to export FreeForm entries so clients can review survey data in Excel. I’m running into a problem with line breaks in the comment fields. Anyone know of an easy trick to import the CSV into Excel so the line breaks don’t case a jump to a new row in Excel?
Sue, for now you can just make a quick change to the source code;
Find this:
switch(strtolower($custom_delimiter))
{
case 'tab' : $delimiter = "\t"; break;
case 'space' : $delimiter = ' '; break;
case 'double-quote' : $delimiter = '"'; break;
case 'single-quote' : $delimiter = '\''; break;
default : $delimiter = $custom_delimiter; break;
}
And add another case:
case 'nothing' : $delimiter = ""; break;
Yes. Essentially the formatting options were added to allow a reasonable amount of flexibility, but nothing quite as flexible as what the query module can achieve, since that accepts and replaces tagdata. I’m beginning to think that a plugin to wrap the query module, with options to insert custom browser headers would offer everything csvee can, plus more, though perhaps not as easy to implement.
Has anyone had an issue exporting dates in a human-readable format with CSVee? We’re trying to export the entry date, but I know the client won’t know a timestamp from a hole in the wall. I tried something like this (simplified query):
{exp:csvee filename="file.csv" seperator="," query="SELECT date_format(entry_date, '%c/%e/%Y')
AS formatted_date, fullname, email FROM exp_freeform_entries WHERE entry_id != ''
AND form_name = 'specificForm' ORDER BY entry_date DESC"}
No matter what I try, the SQL won’t work, and the date field returns empty.
SELECT date_format(entry_date, '%c/%e/%Y') AS formatted_date,
SELECT date_format(entry_date, '%c/%e/%Y') AS entry_date,
SELECT date_format(entry_date, '%c/%e/%Y'),
Is that SQL statement for mySQl 5 only or something? not sure why it wouldn’t work.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.