This module does more for txt that is required.
It adds "[]" before each row and "----------------------------------------" after, without a line feed in between, so rows are separated by "[]----------------------------------------"
Unless this is made configurable, better to do nothing (evrything it possible in the row itself).

I replaced in views-data-export-txt-body.tpl.php.bak.php:

foreach ($themed_rows as $count => $row):
  foreach ($row as $field => $content):
?>
[<?php print $header[$field]; ?>]
<?php print strip_tags($content); // strip html so its plain txt. ?>
<?php endforeach; ?>
----------------------------------------
<?php endforeach;

by
foreach ($themed_rows as $count => $row):
  foreach ($row as $field => $content):
?>
<?php print strip_tags($content); // strip html so its plain txt. ?>
<?php endforeach; ?>
<?php endforeach;

Comments

Actually, stripping all html gives no way to control the output, ie carriage return are impossible.

The correct code in views-data-export-txt-body.tpl.php for using txt output is the following:

<?php
/**
* @file views-view-table.tpl.php
* Template to display a view as a table.
*
* - $title : The title of this group of rows.  May be empty.
* - $rows: An array of row items. Each row is an array of content
*   keyed by field ID.
* - $header: an array of haeaders(labels) for fields.
* - $themed_rows: a array of rows with themed fields.
* @ingroup views_templates
*/
/*<?php print strip_tags($content); // strip html so its plain txt. ?>
*/
foreach ($themed_rows as $count => $row):
  foreach ($row as $field => $content):
?>
<?php print $content; ?>
<?php endforeach; ?>
<?php endforeach;

Version:6.x-2.x-dev» 7.x-3.x-dev
Category:bug» feature
Status:Needs review» Active

Maybe we should change text format so that less is output by default, then one could use rewrite field magic to get it to the correct format as desired.

Maybe we should just provide a way to use a plainer output through the UI.

A UI change to support more flexible formatting would be really great!

In the meantime, I was able to easily reformat the text output by making a template file. Here's how:

In Views - Other - Theme: Information - Alternative style, the template file name is listed there in bold. In my case, I'm formatting results for a RePEc submission, so the template is called 'views-data-export-txt-body--repec-templates.tpl.php'.

I created a new file at /sites/all/themes/mycustomtheme/templates/views-data-export-txt-body--repec-templates.tpl.php and tweaked the PHP for the right formatting. That started working immediately at https://mylovelysite.edu/repectemplates.

<?php
/**
* @file views-data-export-txt-body--repec-templates.tpl.php
* Template to display a view as a table.
*
* - $title : The title of this group of rows.  May be empty.
* - $rows: An array of row items. Each row is an array of content
*   keyed by field ID.
* - $header: an array of haeaders(labels) for fields.
* - $themed_rows: a array of rows with themed fields.
* @ingroup views_templates
*/
foreach ($themed_rows as $count => $row):
  foreach (
$row as $field => $content):
?>

<?php print $header[$field]; ?>: <?php print strip_tags($content); // strip html so its plain txt. ?>
<?php endforeach; ?>
<?php endforeach;

I agree. An option to remove both the "---------------" and "[]" would be amazing.

Thanks to your template snippets, I was able to create exactly what I needed. Thanks!

I needed each row to be a new line and both the brackets and the lines removed. Here is the template that I ended up with.

<?php
/**
* @file views-view-table.tpl.php
* Template to display a view as a table.
*
* - $title : The title of this group of rows.  May be empty.
* - $rows: An array of row items. Each row is an array of content
*   keyed by field ID.
* - $header: an array of haeaders(labels) for fields.
* - $themed_rows: a array of rows with themed fields.
* @ingroup views_templates
*/
foreach ($themed_rows as $count => $row):
  foreach (
$row as $field => $content):
?>

<?php print $header[$field]; ?>
<?php print strip_tags($content); // strip html so its plain txt. ?>
<?php endforeach; ?>
<?php print "\r\n"; ?>
<?php endforeach;

Title:txt export add unrequested separators [] ---------------------------------------- Please make txt export separator "[]" & linebreaks configurable/optional