Kurt Hansen Posted August 11, 2016 Posted August 11, 2016 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?
bruceR Posted August 11, 2016 Posted August 11, 2016 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.
comment Posted August 11, 2016 Posted August 11, 2016 (edited) If you meant tab-delimited, see:http://fmforums.com/topic/51569-export-to-tab-separated-with-column-headers/ Edited August 11, 2016 by comment
Kurt Hansen Posted August 16, 2016 Author Posted August 16, 2016 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: If you meant tab-delimited, see:http://fmforums.com/topic/51569-export-to-tab-separated-with-column-headers/ 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>	</xsl:text></xsl:if> </xsl:for-each> <xsl:text> </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>	</xsl:text></xsl:if> </xsl:for-each> <xsl:if test="position()!=last()"><xsl:text> </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>
</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
</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>
comment Posted August 16, 2016 Posted August 16, 2016 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.
Kurt Hansen Posted August 17, 2016 Author Posted August 17, 2016 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
Recommended Posts
This topic is 3018 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now