Aussie John Posted July 12, 2005 Posted July 12, 2005 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
Vaughan Posted July 12, 2005 Posted July 12, 2005 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.
Aussie John Posted July 13, 2005 Author Posted July 13, 2005 I didnt think there were other options for export or is there another way
Fenton Posted July 13, 2005 Posted July 13, 2005 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>	</xsl:text> </xsl:if> </xsl:for-each> <xsl:text> </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>	</xsl:text> </xsl:when> <xsl:when test="position()=last() and $posRow!=$lastRow"> <xsl:text> </xsl:text> </xsl:when> <xsl:otherwise> </xsl:otherwise> </xsl:choose> </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet>
Aussie John Posted July 18, 2005 Author Posted July 18, 2005 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
Recommended Posts
This topic is 7071 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