importData question

importData question - problems with smath syntax - Messages

#1 Posted: 2/26/2019 6:03:36 AM
RegCurry

RegCurry

0 likes in 57 posts.

Group: User

Sorry to keep asking these syntax questions, but I can't seem to import csv data into an Smath worksheet.

See attached image.

SMATH INPUT DATA ATTEMPT.JPG



Thanks for your continued help.
Reg Curry
#2 Posted: 2/26/2019 7:06:11 AM
Davide Carpi

Davide Carpi

1416 likes in 2873 posts.

Group: Moderator

Hello [userlink]Regulation[/userlink],

this screenshots alone can't say much about the problem; the error message, the content of HEMP_FIELD, the content of the data file are all unknown to us. Usually the best way to have fast help is to attach the involved files, better if simplified as mush as it is in your possibilities, as well as the screenshot.

Back to the main question, you can check if my recent answer here might help you.


P.S. please don't write "all caps" titles, thank you
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#3 Posted: 2/26/2019 7:25:39 AM
RegCurry

RegCurry

0 likes in 57 posts.

Group: User

Thanks Davide,

Here is an update with the actual .sm file and the actual .txt file which DOES INDEED work. I left out the quotes; however, the .csv file still does not work even with quotes in importData(1). Perhaps Smath does not like comma delimited data??????

File not found.File not found.

This forum will not allow me to attach .csv files.

I would like to have the simplest import function without having to specify paths and sheet number. I notice when I copy a path from Windows 7 Professional 64 bit, it will not paste into Smath locations. That means a lot of unnecessary typing. Perhaps this could be corrected in future releases.

Thanks again,
Reg Curry
#4 Posted: 2/26/2019 7:44:34 AM
Davide Carpi

Davide Carpi

1416 likes in 2873 posts.

Group: Moderator

Wrote

Perhaps Smath does not like comma delimited data??????


As I've stated in the linked post, importData is a generic purpose import utility. If you use the 1-argument version, only files with period as decimal separator and tabulation/whitespace as columns separators are imported correctly. To read CSV you have to use the 9-arguments function and specify comma as column delimiter.

Wrote

This forum will not allow me to attach .csv files.


Zip whatever is not allowed to be attached directly (zip, rar, 7z, ...), so we'll check it.

Wrote

I would like to have the simplest import function without having to specify paths and sheet number.


I might introduce an importData.CSV in CustomFunctions; it wasn't introduced in first instance because there already was the built-in importData(9)

Wrote

I notice when I copy a path from Windows 7 Professional 64 bit, it will not paste into Smath locations.


I usually prefer relative locations (relative to the worksheet). About absolute paths, I can copy-paste paths in math strings without troubles (create one with double quotes in a math placeholder, then paste the path), let me know if and how you experience issues.

If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
  • New Posts New Posts
  • No New Posts No New Posts