Tab Delimited CSV Format

Created on 5 April 2012, almost 13 years ago
Updated 6 December 2024, 2 months ago

If there's a way to set the separator to a tab character, I sure don't know what it is. This type of file is actually quite common, and used by the likes of Amazon for sellers to upload product catalogs and ads. I was able to hack support for this in rather easily, but something cleaner would be nice.

What I did was set the separator to "{tab}" in the UI, and modified the views-data-export-csv-body.tpl.php and views-data-export-csv-header.tpl.php files to replace that string with an actual tab character on the fly.

<?php

// Print out exported items.
// Foo: Lets have some tabs...
$foosep = $separator==="{tab}" ? "\t" : $separator;
foreach ($themed_rows as $count => $item_row):
  print implode($foosep, $item_row) . "\r\n";
endforeach;

As I said, definitely a hack, but it works like a charm.
Thanks for an extremely useful module, it saved me a lot of time.

✨ Feature request
Status

Closed: won't fix

Version

3.0

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States DrFoo

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¬πŸ‡§United Kingdom steven jones

    Sorry for the lack of attention to your issue, please accept my apologies.

    Drupal 7 is going to be end-of-life'd by the community in approximately 1 month. β†’

    As such, I am closing all non-critical looking, non-PHP compatibility issues for Views Data Export to tidy up the issue queues and reduce the noise. You can read about this on πŸ“Œ Close down Drupal 7 issues Active .

    If you feel like this issue has been closed by mistake, please do comment about re-opening it.
    If you feel like the ticket is still relevant for the 8.x-1.x version of the module, then please search for a duplicate issue first, and if there really isn't one (and you've looked properly) then change the version on the ticket and re-open.

    Thanks to everyone involved in this issue: for reporting it, and moving it along, it is truly appreciated.
    The Drupal community wouldn't be what it is today without your involvement and effort, so I'm sorry that we couldn't get this issue resolved. Hopefully we'll work together in a future issue though, and get that one resolved :)

Production build 0.71.5 2024