Adding Header information to exported data

8 messages Options
Embed this post
Permalink
Chad Chelius

Adding Header information to exported data

Reply Threaded More More options
Print post
Permalink
I'm exporting the contents of a FMP field to create a list of names  
and addresses. I need to add a header to the exported file but it only  
appears once at the top of the exported file and not before each  
exported record. How would I go about achieving that?

Chad Chelius
Stephen Wonfor

Re: Adding Header information to exported data

Reply Threaded More More options
Print post
Permalink
Chad

Do you mean row 1 is header, row 2 is data, row 3 is header, row 4  
data etc. then you'll need to script the export by writing the data  
into another data table.  Or something.
Or you could give each record a serialID#, have the increment 2, so  
they go 2,4,6,8...
Then create a header row record, set its serial to 1, make a whole  
bunch of them, so they get 1,3,5,7
Sort by serial ID
Export.

But, why do you want the header "before each exported record"

Stephen

----------

"The scientific theory I like best is that the rings of Saturn are  
composed entirely of lost airline luggage."   — Mark Russell.





On Oct 13, 2009, at 4:34 PM, Chad Chelius wrote:

> I'm exporting the contents of a FMP field to create a list of names  
> and addresses. I need to add a header to the exported file but it  
> only appears once at the top of the exported file and not before  
> each exported record. How would I go about achieving that?
>
> Chad Chelius
Steve Cassidy

Re: Adding Header information to exported data

Reply Threaded More More options
Print post
Permalink
In reply to this post by Chad Chelius
On Oct 13, 2009, at 11:34 PM, Chad Chelius wrote:

> I'm exporting the contents of a FMP field to create a list of names  
> and addresses. I need to add a header to the exported file but it  
> only appears once at the top of the exported file and not before  
> each exported record. How would I go about achieving that?

Chad, I think the Merge export option will give you that. You will  
find this option has certain limitations, but it might meet your  
needs. IIRC it's basically a csv file, but with a header in the first  
row.

Steve
Stephen Wonfor

Re: Adding Header information to exported data

Reply Threaded More More options
Print post
Permalink
Chad

Now that I reread your post I see that Steve read it correctly, while  
I ( as Stephen ) did not.  Merge works fine for .csv plus header.  If  
your field names need tweaking you could write a data row of field  
name and arrange to export that as first row, then you could just  
do .csv.

Stephen

----------

"It is impossible for any number which is a power greater than the  
second to be written as a sum of two like powers. I have a truly  
marvelous demonstration of this proposition which this margin is too  
narrow to contain." --- Pierre de Fermat

On Oct 13, 2009, at 5:02 PM, Steve Cassidy wrote:

> On Oct 13, 2009, at 11:34 PM, Chad Chelius wrote:
>
>> I'm exporting the contents of a FMP field to create a list of names  
>> and addresses. I need to add a header to the exported file but it  
>> only appears once at the top of the exported file and not before  
>> each exported record. How would I go about achieving that?
>
> Chad, I think the Merge export option will give you that. You will  
> find this option has certain limitations, but it might meet your  
> needs. IIRC it's basically a csv file, but with a header in the  
> first row.
>
> Steve
Winfried Huslik

Re: Adding Header information to exported data

Reply Threaded More More options
Print post
Permalink
In reply to this post by Chad Chelius
Chad,

I suspect this question is related to your earlier question "InDesign  
carriage return in FMP Calculation field" since the solution is  
exactly the same, except you omit the tag formatting.

You may test this with a file with 5 fields
- name
- street
- city
- state
- zip
export this data (in that order) as XML while using this XSL style  
sheet ('fm2indesign.xsl').


Winfried
www.fmdiff.com


<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:fmp="http://www.filemaker.com/fmpxmlresult" version="1.0"  
exclude-result-prefixes="fmp">
   <xsl:output method="text" encoding="UTF-8" indent="no"/>

   <xsl:template match="//fmp:FMPXMLRESULT">
     <xsl:text><ASCII-MAC>
</xsl:text>
     <xsl:apply-templates select="fmp:RESULTSET"/>
   </xsl:template>

   <xsl:template match="fmp:ROW">
     <!-- name -->   <xsl:text><pstyle:><ct:Regular><cs:
14.000000><cf:Arial></xsl:text>
     <xsl:value-of select="fmp:COL[1]/fmp:DATA"/>
     <xsl:text>
</xsl:text>

     <!-- street -->  
<xsl:text><pstyle:><ct:Regular><cs:
12.000000><cf:Arial></xsl:text>
     <xsl:value-of select="fmp:COL[2]/fmp:DATA"/>
     <xsl:text>
</xsl:text>

     <!-- city -->
<xsl:text><pstyle:><ct:Regular><cs:
12.000000><cf:Arial></xsl:text>
     <xsl:value-of select="fmp:COL[3]/fmp:DATA"/>
     <xsl:text>  </xsl:text>

     <!-- state (if exists) -->
     <xsl:if test="fmp:COL[4]/fmp:DATA!=''">
       <xsl:text><pstyle:><ct:Regular><cs:
12.000000><cf:Arial></xsl:text>
       <xsl:value-of select="fmp:COL[4]/fmp:DATA"/>
       <xsl:text>, </xsl:text>
     </xsl:if>

     <!-- zip -->
  <xsl:text><pstyle:><ct:Regular><cs:
12.000000><cf:Arial></xsl:text>
     <xsl:value-of select="fmp:COL[5]/fmp:DATA"/>
     <xsl:text>
</xsl:text>

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



On 2009-10-14, at 00:34, Chad Chelius wrote:

> I'm exporting the contents of a FMP field to create a list of names  
> and addresses. I need to add a header to the exported file but it  
> only appears once at the top of the exported file and not before  
> each exported record. How would I go about achieving that?
>
> Chad Chelius
Emma Glaisher

Re: Adding Header information to exported data

Reply Threaded More More options
Print post
Permalink
In reply to this post by Chad Chelius
Some javascript/style in this post has been disabled (why?)
If the field is already a calculation, just put something at the top like:

If ( Get ( RecordNumber ) = 1; <header>)

If it isn't, just make a calculation field which concatenates the above and
the rest of the field, and export that. (Is this still the tagged ID file
question?)


On 13/10/09 23:34, "Chad Chelius" <[hidden email]> wrote:

> I'm exporting the contents of a FMP field to create a list of names
> and addresses. I need to add a header to the exported file but it only
> appears once at the top of the exported file and not before each
> exported record. How would I go about achieving that?
>
> Chad Chelius
>
> --------------------------------
> Inbound email scanned by Mimecast.
> --------------------------------
>


Emma Glaisher
Artworker and Database Development
Fourninety Limited

Tel: 0113 238 2447
[hidden email]
http://www.fourninety.com/

Fourninety Limited, a member company of the Media Square plc group. Registered in England No. 3737606. Registered address Clarence Mill, Clarence Road, Bollington, Cheshire. SK10 5JZ

Confidentiality Notice: The information in this document and any attachments are confidential. It is intended only for the use of the named recipient. If you are not the intended recipient please notify us immediately and delete this document. The contents on this document must not be disclosed to any other person nor may any copies be taken. The views of the author may not represent the views of the Company.

Security Warning: This e-mail has been created in the knowledge that Internet e-mail is not a 100% secure communications medium. All liability for any claims arising as a result of using this medium to transmit information by us or to us is excluded to the extent permitted by law.
Emma Glaisher

Re: Adding Header information to exported data

Reply Threaded More More options
Print post
Permalink
In reply to this post by Stephen Wonfor
Some javascript/style in this post has been disabled (why?)
Sorry, may have misunderstood 'header'!


On 14/10/09 00:11, "Stephen Wonfor" <[hidden email]> wrote:

> Chad
>
> Now that I reread your post I see that Steve read it correctly, while
> I ( as Stephen ) did not. Merge works fine for .csv plus header. If
> your field names need tweaking you could write a data row of field
> name and arrange to export that as first row, then you could just
> do .csv.
>
> Stephen
>
> ----------
>
> "It is impossible for any number which is a power greater than the
> second to be written as a sum of two like powers. I have a truly
> marvelous demonstration of this proposition which this margin is too
> narrow to contain." --- Pierre de Fermat
>
> On Oct 13, 2009, at 5:02 PM, Steve Cassidy wrote:
>
>> On Oct 13, 2009, at 11:34 PM, Chad Chelius wrote:
>>
>>> I'm exporting the contents of a FMP field to create a list of names
>>> and addresses. I need to add a header to the exported file but it
>>> only appears once at the top of the exported file and not before
>>> each exported record. How would I go about achieving that?
>>
>> Chad, I think the Merge export option will give you that. You will
>> find this option has certain limitations, but it might meet your
>> needs. IIRC it's basically a csv file, but with a header in the
>> first row.
>>
>> Steve
>
> --------------------------------
> Inbound email scanned by Mimecast.
> --------------------------------
>


Emma Glaisher
Artworker and Database Development
Fourninety Limited

Tel: 0113 238 2447
[hidden email]
http://www.fourninety.com/

Fourninety Limited, a member company of the Media Square plc group. Registered in England No. 3737606. Registered address Clarence Mill, Clarence Road, Bollington, Cheshire. SK10 5JZ

Confidentiality Notice: The information in this document and any attachments are confidential. It is intended only for the use of the named recipient. If you are not the intended recipient please notify us immediately and delete this document. The contents on this document must not be disclosed to any other person nor may any copies be taken. The views of the author may not represent the views of the Company.

Security Warning: This e-mail has been created in the knowledge that Internet e-mail is not a 100% secure communications medium. All liability for any claims arising as a result of using this medium to transmit information by us or to us is excluded to the extent permitted by law.
Steve Cassidy

Re: Adding Header information to exported data

Reply Threaded More More options
Print post
Permalink
In reply to this post by Stephen Wonfor
On Oct 14, 2009, at 12:11 AM, Stephen Wonfor wrote:

> Now that I reread your post I see that Steve read it correctly,  
> while I ( as Stephen ) did not.

My mum calls me Stephen, but most know me as Steve!

S