×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: Quotes in CSV placeholder

Quotes in CSV placeholder 7 years 7 months ago #29506

  • Rob Swart
  • Rob Swart's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 57
  • Thank you received: 5
Hi Yves,

Since I can populate my booking fields with Community Builder variables, I am using the MAT_CSV_BOOKING_DETAILS placeholder to create CSV files.
I noticed that every cell in the Excelsheet contains single quotes (') around the content of the booking fields.
Is there a special reason you're doing this? Because these quotes limit the functionality of Excel.
I've seen that is is purposely programmed in util_templates.php but I can't figure out why.

Would it be possible to remove these quotes from the CSV building functions? Or does this cause problems elsewhere?
I have removed them from the script and everything seems to be working fine without them.

Greets,
Rob

PS: this can wait till after Christmas ;)

Quotes in CSV placeholder 7 years 7 months ago #29507

  • Yves Hoppe
  • Yves Hoppe's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 3519
  • Karma: 71
  • Thank you received: 556
Hi Rob,

you can set that the csv is quoted in Excel (mine does it automatically) when you import a csv file (Import dialog - Excel is a mess with CSV in some language settings / versions).

The reason for the quotes is, that the data may contain line breaks, double quotes and other things which have to be quoted in order to prevent the csv file to break.

en.wikipedia.org/wiki/Comma-separated_va...ward_standardization

Fields containing a line-break, double-quote, and/or commas should be quoted. (If they are not, the file will likely be impossible to process correctly).


I've hardcoded it just for MAT_BOOKING_ALL_DETAILS_CSV (going to make a setting for the quotes sometime too), so you can easily avoid it by creating your own CSV template without quotes :-)

MAT_BOOKING_FIRSTNAME; MAT_BOOKING_LASTNAME etc.

Kind regards,

Yves
The following user(s) said Thank You: Rob Swart

Quotes in CSV placeholder 7 years 7 months ago #29510

  • Rob Swart
  • Rob Swart's Avatar Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 57
  • Thank you received: 5
Hi Yves,

I told you this could wait till after Christmas :cheer:
That you are even considering logging on, on this hollyday is astounding :P
Thanks again for you superb support!!!!

And thanks a lot for your explaination. I didn't know this, so thanks for the Excel lesson.
I've made a new template with the bookingfields themselves and it works as a charm.
So, no bug but a feature. One I won't use, but I'm sure it will come in handy to other users.

Thanks again!
And now, go back to the turkey and eggnut :D
Rob
  • Page:
  • 1
Time to create page: 0.129 seconds