Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

No header when exporting to CSV file

Featured Replies

If I make an export to at TAB-delimited CSV-file there is no header (first line with field names). Why and how do I add this automaticly?

1. Which is it? A  tab delimited file is not a CSV (comma delimited).

2. I f CSV is you want, choose the merge option.

  • Author
On 11/8/2016 at 9:26 AM, BruceR said:

1. Which is it? A  tab delimited file is not a CSV (comma delimited).

2. I f CSV is you want, choose the merge option.

Sorry, Bruce. You are right. I want TAB delimited.

On 11/8/2016 at 11:04 AM, comment said:

Thanks, Comment. Unfortunately these solutions are too complicated for me. Fenton's example (Export_Tab_wHeader_xml.zip) works fine. My problem is how to merge Fonton's .xls with my existing ditto:

Fenton:

<?xml version='1.0' encoding='utf-8'?>
<xsl:stylesheet xmlns:fmp="http://www.filemaker.com/fmpxmlresult"
exclude-result-prefixes="fmp" version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
	<xsl:template match="/">
		<xsl:for-each select="fmp:FMPXMLRESULT/fmp:METADATA">
			<xsl:for-each select="fmp:FIELD">
					<xsl:value-of select="@NAME"/>
					<xsl:if test="position()!=last()"><xsl:text>&#09;</xsl:text></xsl:if>
			</xsl:for-each>
		<xsl:text>&#10;</xsl:text>
		</xsl:for-each>
		<xsl:for-each select="fmp:FMPXMLRESULT/fmp:RESULTSET/fmp:ROW">
			<xsl:for-each select="fmp:COL/fmp:DATA">
					<xsl:value-of select="."/>
					<xsl:if test="position()!=last()"><xsl:text>&#09;</xsl:text></xsl:if>
			</xsl:for-each>
			<xsl:if test="position()!=last()"><xsl:text>&#10;</xsl:text></xsl:if>
		</xsl:for-each>
	</xsl:template>
</xsl:stylesheet>

Kurt:

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fmp="http://www.filemaker.com/fmpxmlresult">

<xsl:output method="text" encoding="ISO-8859-1"/>

<xsl:variable name="CRLF">
<xsl:text>&#x000D;&#x000A;</xsl:text>
</xsl:variable>

<xsl:variable name="delimiter">
	<xsl:text>	</xsl:text>
</xsl:variable>

<xsl:template match="/">
    <xsl:text>v_products_model	v_products_name_1	v_products_description_1	v_products_page_title_1	v_products_meta_keywords_1	v_products_meta_description_1	v_products_short_description_1	v_products_image	v_products_price_per	v_products_ean	v_products_price	v_products_quantity	v_products_weight	v_categories_name_1_1	v_categories_name_2_1	v_categories_name_3_1	v_manufacturers_name	v_tax_class_title	v_status	EOREOR&#x000D;&#x000A;</xsl:text>

<xsl:for-each select="fmp:FMPXMLRESULT/fmp:RESULTSET/fmp:ROW">
	<xsl:for-each select="fmp:COL">
		<xsl:value-of select="fmp:DATA"/>
		<xsl:choose>
			<xsl:when test="position()=last()">
				<xsl:value-of select="$CRLF"/>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="$delimiter"/>
			</xsl:otherwise>
		</xsl:choose>
	</xsl:for-each>
</xsl:for-each>

</xsl:template>
</xsl:stylesheet>

 

2 hours ago, Kurt Hansen said:

My problem is how to merge Fonton's .xls with my existing ditto:

That's not a good description of a problem. What exactly is wrong with your attempt? Assuming you want to hard-code the column names in the header, instead of copying the field names from your database, I see no reason why this would not work - provided you export the fields in the same order as required by the header.

  • Author

I'm sorry, Comment. I realize now that I made a mistake in "Export Records" in the script. I specified "Tab-Separeted Text" as filetype - not "XML". Everything is working fine now.

Thank you for your general helpfulness :)

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.