We use cookies to improve your experience. No personal information is gathered and we don't serve ads. Cookies Policy.

ExpressionEngine Logo ExpressionEngine
Features Pricing Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University
Log In or Sign Up
Log In Sign Up
ExpressionEngine Logo
Features Pro new Support Find A Developer
Partners Upgrades
Blog Add-Ons Learn
Docs Forums University Blog
  • Home
  • Forums

Plugin: CSVee

Development and Programming

Jesse Bennett-Chamberlain's avatar
Jesse Bennett-Chamberlain
10 posts
18 years ago
Jesse Bennett-Chamberlain's avatar Jesse Bennett-Chamberlain

Sounds perfect!

       
Daniel Walton's avatar
Daniel Walton
553 posts
18 years ago
Daniel Walton's avatar Daniel Walton

Updated with additional formatting parameters:

fixed_width pad_character seperator delimiter show_headings

       
Jesse Bennett-Chamberlain's avatar
Jesse Bennett-Chamberlain
10 posts
18 years ago
Jesse Bennett-Chamberlain's avatar Jesse Bennett-Chamberlain

Awesome! Thanks!

       
Simon Rudkin's avatar
Simon Rudkin
51 posts
17 years ago
Simon Rudkin's avatar Simon Rudkin

Fantastic plugin, thank-you! You’ve probably guessed that flattery precedes a question… any way to have no seperator or delimiter?

       
Daniel Walton's avatar
Daniel Walton
553 posts
17 years ago
Daniel Walton's avatar Daniel Walton

Hello Simon.

Unfortunately…: No. CSV format, by it’s nature, requires at very least a separating character to distinguish between columns of data. This is bolstered by use of delimiting tokens, so that chances of misinterpretation of column boundaries is less likely.

May I ask why you would want no separation between columns?

       
Simon Rudkin's avatar
Simon Rudkin
51 posts
17 years ago
Simon Rudkin's avatar Simon Rudkin

I guess it’s in the name - CSV - isn’t it? (Slaps head). What I’m trying to achieve is a comma or tab between records, but no other characters around each record…

       
Daniel Walton's avatar
Daniel Walton
553 posts
17 years ago
Daniel Walton's avatar Daniel Walton

Could you just use the query module, then?

       
Simon Rudkin's avatar
Simon Rudkin
51 posts
17 years ago
Simon Rudkin's avatar Simon Rudkin

I could… but the file output is super-useful. I’ve cracked it with a dirty hack to the plugin. Cheers again!

       
msteinruck's avatar
msteinruck
27 posts
17 years ago
msteinruck's avatar msteinruck

Is there a way to filter the data by field? For example, I’m trying to pull entries from Freeform but I want to limit it to a certain form on the site. I tried using the WHERE clause, but that makes the plugin throw an error.

       
Daniel Walton's avatar
Daniel Walton
553 posts
17 years ago
Daniel Walton's avatar Daniel Walton

It does? Could you post up the sql you are issuing?

       
msteinruck's avatar
msteinruck
27 posts
17 years ago
msteinruck's avatar msteinruck

You bet, here it is:

{exp:csvee filename="call_registration.csv" fixed_width="200" group_id="1|6" query="SELECT first_name, last_name, call_email, phone1, questions, mailinglist, template FROM exp_freeform_entries WHERE template='callregistration'"}
       
Daniel Walton's avatar
Daniel Walton
553 posts
17 years ago
Daniel Walton's avatar Daniel Walton

Hmm, I can’t replicate the problem…

When you say it throws an error… how so? in the outputted file? or before? what IS the error?

Also, have you attempted running that query within the sql query form to ensure it’s not the query causing a problem?

( way too many ? but hey-hum :] )

For what it’s worth I tried a simple query

select title, url_title from exp_weblog_titles where day = '01'

Does this work for you?

       
msteinruck's avatar
msteinruck
27 posts
17 years ago
msteinruck's avatar msteinruck

This is the most bizarre thing ever. I just revisited this issue today and the exact same code that I pasted above worked this time! I don’t know what was different, but it works flawlessly. Thanks for your help butcher!

       
tpayton's avatar
tpayton
172 posts
17 years ago
tpayton's avatar tpayton

Great plugin.

So I need to export some of the custom member profile fields for each member.

Any idea of how to do that?

       
Daniel Walton's avatar
Daniel Walton
553 posts
17 years ago
Daniel Walton's avatar Daniel Walton

Sure, just join the member data table ala:

SELECT m.screen_name, d.m_field_id_1 FROM exp_members AS m LEFT JOIN exp_member_data AS d ON d.member_id = m.member_id
       
1 2 3 4 Last

Reply

Sign In To Reply

ExpressionEngine Home Features Pro Contact Version Support
Learn Docs University Forums
Resources Support Add-Ons Partners Blog
Privacy Terms Trademark Use License

Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.