Skip to content

saveTable() wrong csv output #2842

@thomasvanhemert

Description

@thomasvanhemert

Hey all,
I hope this is the right place to post this but I figured you might be of help here. I'm working on a p5 javascript project where I load a csv file with loadTable() in the preload() function. And I am saving it again later in my setup() with the saveTable() function when a button is pressed. Now comes my problem, the output csv is not in the right format. The function saveTable() exports the following:

sessionId,timeStamp,selectedItems100000,3-5-2018_10:24,EPC123412341234123412340001

But i need it to output it as seperate rows instead of all the rows placed besides each other. Like this:

sessionId,timeStamp,selectedItems
100000,3-5-2018_10:24,EPC123412341234123412340001

This is the part of the code that prepares and exports the csv file:

var newRow = sessionLog.addRow();
newRow.setNum('sessionId', sessionId);
newRow.setString('timeStamp', timeStamp);
newRow.setString('selectedItems', selectedItems);
saveTable(sessionLog, 'sessionLog.csv', 'csv');

Coud any of you help me with this?

Nature of issue?

  • Found a bug (i have a question)
  • Existing feature enhancement
  • New feature request

Most appropriate sub-area of p5.js?

  • Color
  • Core/Environment/Rendering
  • Data
  • Events
  • Image
  • IO
  • Math
  • Typography
  • Utilities
  • WebGL
  • Other (specify if possible)

Which platform were you using when you encountered this?

  • Mobile/Tablet (touch devices)
  • Desktop/Laptop
  • Others (specify if possible)

Details about the bug:

  • p5.js version: p5.js v0.5.4 October 01, 2016
  • Web browser and version: Chrome version 66.0.3359.139
  • Operating System: Windows 10 Version 10.0.15063 Build 15063
  • Steps to reproduce this: See the top of the post.

Feature enhancement details:

New feature details:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions