3
$\begingroup$

I'm sure there's a better way to accomplish this, but my goal is to generate a .csv file from a running notebook, and have it accessible by API.

In the main program, I'm exporting the data like so:

CloudExport[csvTable,"CSV","outputFile.csv"];

From there, I'm able to access it and expose it using

CloudDeploy[APIFunction[{}, StringForm[CloudImport["outputFile.csv","Text"]]],Permissions->"Public"]

When I do a CloudImport in a notebook (as text), the data looks correct. But when I open it in the API, it is quoted and appended with [<||>]

Is there a better way to do this? How can I prevent the additional characters from being added? In the end I just want an external consumer to access and process the data.

thanks!

$\endgroup$
  • $\begingroup$ also, I can't CloudImport as "CSV" because the output will just be a Mathematica Array. $\endgroup$ – Rick R Nov 3 '14 at 5:58
  • $\begingroup$ Well, it doesn't exactly solve the problem, but it helps with my problem. I think I can skip the additional API step by doing CloudExport[csvTable,"CSV","outputFile.csv",Permissions->"Public"]; $\endgroup$ – Rick R Nov 3 '14 at 6:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.