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.

Featured Replies

I have 4 fields of data I want to export to a file. I tried to export as a .csv file BUT all of my field data contain quotes around them and I want to export the first 2 fields with quotes around them and the last two fields without quotes around them as the data needs to be in this format.

Is there a way to do this?

Have you tried other formats?

  • Newbies

The interesting element of your question is that you want some fields to export with quotes and others without them.

Assuming that you don't want to assume your users will remember to add quotes to the desired fields ('cause they won't), you could easily create hidden utility fields that add them! When it's time to export, simply export the utility fields along with the regular fields.

Example

Your original field list:

Field01 - (desire to export with quotes)

Field02 - (desire to export with quotes)

Field03 - (desire to export without quotes)

Field04 - (desire to export without quotes)

Create 2 new fields:

Field01ForExport (calc field) = Char ( 34 ) & Field01 & Char ( 34 )

Field02ForExport (calc field) = Char ( 34 ) & Field02 & Char ( 34 )

Note that the calc engine cannot properly read """ (a quotation mark surrounded by quotation marks), we need to take advantage of the new Char function which allows us to enter the ASCII number for the quotation mark to get our desired result.

Fields to Export:

Field01ForExport

Field02ForExport

Field03

Field04

Hope this helps,

Jim

Edited by Guest

Basically, you have two options here:

1.

Define a calculation field (result is Text) =

""" & Field1 & "","" & Field2 & ""," & Field3 & "," & Field4

Export ONLY the calculation field, using the tab-separated format.

2.

Export as XML, using a custom XSLT stylesheet - see here for something similar:

http://fmforums.com/forum/showpost.php?post/198404/

Create 2 new fields:

Field01ForExport (calc field) = Char ( 34 ) & Field01 & Char ( 34 )

Field02ForExport (calc field) = Char ( 34 ) & Field02 & Char ( 34 )

Note that the calc engine cannot properly read """ (a quotation mark surrounded by quotation marks), we need to take advantage of the new Char function which allows us to enter the ASCII number for the quotation mark to get our desired result.

Fields to Export:

Field01ForExport

Field02ForExport

Field03

Field04

I don't think that's going to work: if you export as cvs, you will get triple quotes around the first two fields, and the last two fields will still be surrounded by quotes. If you export as tab-separated, you will get tabs where commas are expected.

  • Newbies

Thanks for the clarification. I neglected to specify exporting as a tab-delimited file. My unvoiced assumption (yikes!) was that since the original poster didn't seem tied to having a csv file at tab-delimited file would be fine.

Jim

  • Author

I'd like to thank you and Jim for your responses. Coming from a 4D world I still think in terms of 4D and always seem to forget that you can accomplish a lot with the "calculation field".

Thanks for the insight and wonderful responses.

Dom

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.