Jump to content

This topic is 6947 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Hi, I cant seem to export a .tab file with the field titles at the top (only the actual entries). Is this possible?

I want to export to a text file that address book can import with minimal user input.

thanks

Link to comment
Share on other sites

As far as I know, only merge (.mer) files and HTML Tables (.htm) have field names in the first row. Merge files are csv.

Otherwise, you'll have to roll-your-own with an XML export.

Link to comment
Share on other sites

As Vaughan says, you can use XML. I recently did this, so I'll pass it along. It's a generic "export tabbed text with the field names" xsl. It is utf-8 with Unix line breaks, which is fairly standard for xml, but not necessarily for other text. It can be read with any Unicode-aware text application on either platform. But you can change this if needed.

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

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

xmlns:fm="http://www.filemaker.com/fmpxmlresult" exclude-result-prefixes="fm" >

<xsl:output method="text" version="1.0" encoding="utf-8" indent="no"/>

<xsl:template match="/">

<!-- This is what FileMaker XML-format Exports, just to show you where we're getting the field names from.

<METADATA>

<FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="ApplicationData" TYPE="TEXT" />

<FIELD EMPTYOK="YES" MAXREPEAT="1" NAME="PropType" TYPE="TEXT" />

etc.

</METADATA>

-->

<xsl:for-each select="fm:FMPXMLRESULT/fm:RESULTSET/fm:ROW[1]">

<xsl:for-each select="../../fm:METADATA/fm: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="fm:FMPXMLRESULT/fm:RESULTSET/fm:ROW">

<xsl:variable name="posRow" select="position()"/>

<xsl:variable name="lastRow" select="last()"/>

<xsl:for-each select="fm:COL/fm:DATA">

<xsl:value-of select="."/>

<xsl:choose>

<xsl:when test="position()!=last()">

<xsl:text>&#09;</xsl:text>

</xsl:when>

<xsl:when test="position()=last() and $posRow!=$lastRow">

<xsl:text>&#10;</xsl:text>

</xsl:when>

<xsl:otherwise>

</xsl:otherwise>

</xsl:choose>

</xsl:for-each>

</xsl:for-each>

</xsl:template>

</xsl:stylesheet>

Link to comment
Share on other sites

Thanks Fenton- I just wish i knew what you wrote :

I ended up using applescript to make a file with the headers and combined it with the exported file to import to the address book. Works great. Thank again Fenton with the help in applescript forum resolving this issue

Link to comment
Share on other sites

This topic is 6947 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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