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.

Export to tab-separated with column headers

Featured Replies

Hi all,

Is there a straightforward way to export tab-separated values with field names becoming the first row, i.e., column headers? I only see this option available when "Saving As.." an Excel spreadsheet.

Thanks in advance!!!

If you're willing to try an XML Export, with an XSL stylesheet, the following, as the xsl file, will produce a tab-separated text file, with a header line of the field names. The resulting line endings are Unix (ASCII 10), but usually work cross-platform.

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



exclude-result-prefixes="fmp" version="1.0"

xmlns:xsl="http://www.w3.org/1999/XSL/Transform">



	

		

			

					

					

			

		

		

		

			

					

					

			

			

		

	

Alternately, you could script adding a record to the found set that sorts at the top of the list, which contains the field names in that record. You could then export the data, and then delete that temporary record.

  • Author

Hi Fenton,

I gave that a try and this is what I end up with. Any ideas?

Thanks!

XSLT_Warning.gif

  • Author

Hi Reed,

Thanks for the reply. The way you suggested was one of the ways I'd thought of, but am trying to avoid. If I can get Fenton's way to work for me I'll be a happy camper.

Cheers!

  • Author

BTW Fenton, I tried this on Windows also, and received a similar message.

When you see an error with the 1st character of the file, it usually means some other character than the < which begins the xml declaration is the 1st character, which means either a character you can see, or else it's an encoding error. UTF-16 is often the culprit. In any case it's difficult to copy/paste off a web page sometimes.

So here is again, attached. Try that. Do not open or save with a word processor; use a text editor that can show you the encoding. If that doesn't work, I'll include it with a FileMaker file using it.

Field_Names_as_Header_xsl.zip

  • Author

Hi again, Fenton,

I opened the downloaded text with SuperEdi (on Windows) with UTF-8 as the default encoding, but I get the same results as before. I'd really appreciate it if I could take you up on your offer of the style sheet already in a FM file.

I haven't worked with XSL stylesheets before, but this seems like as good a time as any to get my feet wet.

Many thanks!

  • Author

Works like a charm when I set my solution up to follow your example. I'm wondering if I was doing something wrong before (probably). I wasn't referring to it as an external stylesheet, but rather as a calculation that got the content of the stylesheet from global field. I also tried exporting from the file menu, i.e. not using a script, by pasting the stylesheet's content in the field for HTTP Request in the dialog that appears.

Sorry if this was the cause of the failure. Any tips, comments, etc. over the "whys" and "how-tos" of working with XML and stylesheets are welcome.

Thanks a lot, Fenton! This is some cool stuff that's certainly piqued my interest...no turning back now.

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.