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.

csv output and formatting a combination field so it has spaces

Featured Replies

I am trying to export a selection of records. I export them into a csv file. One of the fields is made up of several other concatenated together.

 

e.g.

 

field1  & " " & TextStyleAdd ( field2; Bold ) &  Case( IsEmpty(field2); "";  "")  & "¶"  & TextStyleAdd(field3;SmallCaps) & "¶" & field4  & "¶" & TextStyleAdd ( field5; Italic ) &  Case( IsEmpty(field5); "";  " ") & " "   &  Case( IsEmpty(field5); "";  "¶¶")  & field6 &  Case( IsEmpty(field6); "";  "¶") & Score_100 &   Case( IsEmpty( field7) ; " "; TextStyleAdd ( "/ "; Subscript ))   & " " & Year( Date) & Case( IsEmpty(Date); ""; TextStyleAdd ( "  [Date]"; Superscript )) &  Case ( 0 ; ( field8 ) * 100 & "%" )  &  Case( IsEmpty(field8); "";  "¶")  & GetAsText ( field9 )  & Case( IsEmpty(field9); "";  "¶")  & Case ( 0 ; ( Alcohol ) * 100 & "%¶" )  & Region::Appellation&Case( IsEmpty(Region::Appellation); "";  "¶") & Region::Region&Case( IsEmpty(field1a); "";  "¶")  & field1b&Case( IsEmpty(Region::field1b); "";  "¶")  & field1c&Case( IsEmpty(field1c); "";  "")

 

The field looks fine in FM (8.5 by the way), but when I EXPORT this to a csv file most of the contents of this run together and don't retain the formatting of the paragraphing as shown above. On the other hand if I 'SAVE AS' and choose Excel it seems better and then I convert into a csv using say OpenOffice.

 

What can I do to keep the formatting to export to a csv - I click the retain formatting link ? Thanks.

 

CSV is a plain-text format, it doesn't support style formatting.

when I EXPORT this to a csv file most of the contents of this run together

 

When you export as .csv, carriage returns in a field are exported as vertical tab characters (ASCII 11). This can be avoided by exporting as XML and using a custom XSLT stylesheet to transform the output to csv. Or post-process the file in a third-party app, replacing the vertical tabs by CR and/or LF characters.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.