Data Exchange plugin - share data between SMath Studio and CSV/ODF/ODS/ODT/XeLaTeX files - Messages
Here there is a plugin to share data between SMath and:
- CSV files (to export variables and functions);
- ODF Formulas (to export variables and functions);
- ODS Spreadsheets (to import/export variables and functions);
- ODT Text documents (to save worksheets with editable text and formulas);
- XeLaTeX text documents (to save worksheets with editable text and formulas).
Plugin UI languages:





- requirements: SMath Studio 0.97.5346 or later, .Net Framework 2.0 (Windows) / Latest Mono distributive (Linux);
- installation: download the plugin from the gallery;
- documentation: DataExchange_docs.7z (388 KiB) downloaded 616 time(s).;
- sources: SVN repository.
- languages: if you want to have a new UI language look into the documentation's Language folder.
Attached below, OLD documentation for SMath Studio prior to 0.97.5346 (0.96.5146 <= SS < 0.97.5346)
DataExchange_docs.7z (396 KiB) downloaded 731 time(s).
I can't open the generated ods file with msexcel, msword or by importing it into gdrive.
FYI the third outputdirexctory is valid for vista as well.
I wonder if you have more plans for these kind of interactions between smath and spreadsheet softwares

WroteThanks!
I can't open the generated ods file with msexcel, msword or by importing it into gdrive.
FYI the third outputdirexctory is valid for vista as well.
I wonder if you have more plans for these kind of interactions between smath and spreadsheet softwares
Hi kilele

I've fixed the issue (I think); it depends on the starting template... ODS produced by LibreOffice 3.6.4 can't be opened directly by MS office without recovery (at least for me), now I've found another template (from OpenOffice) and seem that work fine.
I've fixed also some issues with decimal separator [edit] and I've changed the function names (according with the built-in importData function)
An import function would be nice, but seems not an easy task

regards,
w3b5urf3r
P.S. if you have previously downloaded the "CSV export.dll" plugin don't forget to delete it from the plugin folder.

(this worked right on my other pc with vista)
the .ods is still not opening, actually libreoffice calc says is a corrupt file.
I don't know what you mean by ods template, you may try to convert the csv file to other formats and see the xml format ? for example: convert csv to xlsx, and then xlsx to ods; or convert csv to ods from within gdrive(google) or skydrive(microsoft)
As for the import function, I don't know if you could use a mit licensed component which deals with openxml and allows to create/process excel(calc) sheet without having installed those programs, it is called SpreadsheetLight
the .sm sample expects a subdirectory called "outputDirectory"

this worked right on vista though
the ods is still not opening, actually libreoffice calc says it is a corrupt file.
I don't know what you mean by ods template, you may try to convert the csv to xlsx, and then to ods from within excel and see the structure of the xml file ? or convert the csv to ods from webservices like gdrive(google) or skydrive(microsoft)
As for the import function, I don't know if you could make use of a mit licensed component which deals with openxml to create/process spreadsheets without requiring excel or calc,
it is called spreadsheetlight
thanks a lot for your newest contribution to SMath functionality. exportData.CSV works fine for me, ods is unreadable by Excel. I understand, the given pathnames are just examples. You could use any path, including current directory "."
Might be worth to mention that it is not trivial to paste filenames with spaces into function placeholders.
1. paste the clipboard content to the canvas (automatically becomes a text cell if it has spaces)
2. Bracket the text with ""
3. Copy Text including ""
4. Paste into exportData or wherever you need a string with spaces.
Of course, this would be obsolete, if SMath would automatically add string data type markup if the clipboard text is not a valid SMath expression and deliberately is pasted to a math region. Perhaps I should post a feature request.
Best regards, Martin
Wrotetested on xp:
the .sm sample expects a subdirectory called "outputDirectory"![]()
this worked right on vista though
the ods is still not opening, actually libreoffice calc says it is a corrupt file.
I don't know what you mean by ods template, you may try to convert the csv to xlsx, and then to ods from within excel and see the structure of the xml file ? or convert the csv to ods from webservices like gdrive(google) or skydrive(microsoft)
As for the import function, I don't know if you could make use of a mit licensed component which deals with openxml to create/process spreadsheets without requiring excel or calc,
it is called spreadsheetlight
I've fixed the issues (all related to unassigned path/filename variables, wrong paths and error handling).
EDIT: plugin updated again with ODS better handling of text variables.
any ODF file it's a zip archive (with a custom extension *.od*) that contain many files (xml,png,...). As first approach I've create an empty ods file from LibreOffice, I've unzipped the ods and I've used the sources as template. Updating the template using a OpenOffice file seem that the output could be opened both from MS excel and Google Docs [Gdocs -> create -> spreadsheet -> file -> open -> upload]

The spreadsheetlight plugin it's not compatible (.NET Framework version required is .NET Framework 3.5 instead of 2.0)
WroteHi w3b5urf3r,
thanks a lot for your newest contribution to SMath functionality. exportData.CSV works fine for me, ods is unreadable by Excel. I understand, the given pathnames are just examples. You could use any path, including current directory "."
Might be worth to mention that it is not trivial to paste filenames with spaces into function placeholders.
1. paste the clipboard content to the canvas (automatically becomes a text cell if it has spaces)
2. Bracket the text with ""
3. Copy Text including ""
4. Paste into exportData or wherever you need a string with spaces.
Of course, this would be obsolete, if SMath would automatically add string data type markup if the clipboard text is not a valid SMath expression and deliberately is pasted to a math region. Perhaps I should post a feature request.
Best regards, Martin
ODS fixed (I hope)
You're right, you can use any existing path where you have permissions to read and write files (BTW inserting or not a backslash at the end of the filepath doesn't cause issues).


best regards,
w3b5urf3r
-support just .xlsx and we're done!
-I don't think .net above 2.0 version is a problem, as far as I know Andrey targeted .Net2.0 to support old versions of windowsMobile and there are not smath versions for that platform since 0.90, however I don't know how this would affect to linux/mono
WroteTest on xp:
-the sample does not report errors but now it outputs csv and ods at the same directory as the smath sheet.
-the ods file can't be opened with excel_2007_SP1 but it seems that is required at least 2007_SP2
-the output files does not correspond to the matrix on the sample, see screenshots.
Hi kilele, thank you for your examination

The outputDirectory value it's customizable, in the new DataExport.sm the first definition only it's enabled (output sent in the sheet folder).
I consider the 2nd issue a SP1 lack (otherwise the SP2 did not contain any changes about ODF); consider that you can open the ODS with a LibreOffice/OpenOffice for free (even with a portable app) and resave the file as a *.xls or a *.xlsx file.
Consider that a csv file works fine when you share numbers and text; the example contains also nested matrices for testing purposes but I would not recommend to share SMath symbolical data using a CSV file. Besides to load correctly a CSV in MS office you need to import it (On the Data tab, in the Get External Data group, click on "From text" > choose the file to load, set delimiters and others options...); LibreOffice start the import procedure when you open the file, so there are not issues... EDIT obviously I can extend the CSV export features to export symbolical data as a string.
WroteSuggestions:
-support just .xlsx and we're done!
-I don't think .net above 2.0 version is a problem, as far as I know Andrey targeted .Net2.0 to support old versions of windowsMobile and there are not smath versions for that platform since 0.90, however I don't know how this would affect to linux/mono
I prefer the Open Document Standard (Because it's readable from anyone for free, and because I don't have MS office in my home PC XD )
I've already tried to implement a .NET framwork 4.0 plugin in SMath (math.net numerics plugin ) without success...


Cheers!
THE PROJECT NAME IS CHANGED SO PLEASE DELETE ANY OLD PLUGIN ('DataExport.dll' or 'CSV export.dll', if any)
- added new functions [MATH lang=eng]importData.ODS(3)[/MATH] and [MATH lang=eng]importData.ODS(4)[/MATH]

- added new functions [MATH lang=eng]exportData.CSV(2)[/MATH] and [MATH lang=eng]exportData.ODS(2)[/MATH]
best regards,
w3b5urf3r
You are giving SMath a good bath on steroids

Edit:
I have to withdraw my unconditional regard to your person,
since the export sample worked as in my test on xp the other day, see screenshots above.
I've forgot

fixed & updated REMEMBER TO DELETE ANY OLD PLUGIN ('DataExport.dll' or 'CSV export.dll', if any)
As for the MS Office 2007 SP1 import of ODS files, my idea still remain to convert the file with a third party application (LibreOffice/OpenOffice/webservice); alternatively, here there is a free ODF Add-in for Microsoft Office or the official "2007 Microsoft Office Suite Service Pack 3 (SP3)" (or we can hope for a future evolution of the xls plugin...)
best regards,
w3b5urf3r
All my respect for this plugin as well



Just tried a bit to see the ODS I/O functions (LibreOffice 3.5.7). I used a bit larger numerical data table. This is one of the most desirable feature expected from the import/export data function AFAIC. Just see the picture, please. It seems quite Ok. By the way, as we all know, it is not desirable to represent the entire large matrix in SMath. It will cause troubles by occupying large amount of space.
The first picture is some data made in Calc. The second one is an import to SMath. The third one is made by exporting the matrix. I have no complaints about it. It seems it works just fine, although I was just curious why the scientific format changed while importing and exporting. Actually, I think this is not a big issue.
Regards,
Radovan
WroteHello w3b5urf3r,
All my respect for this plugin as well,
![]()
![]()
Just tried a bit to see the ODS I/O functions (LibreOffice 3.5.7). I used a bit larger numerical data table. This is one of the most desirable feature expected from the import/export data function AFAIC. Just see the picture, please. It seems quite Ok. By the way, as we all know, it is not desirable to represent the entire large matrix in SMath. It will cause troubles by occupying large amount of space.
The first picture is some data made in Calc. The second one is an import to SMath. The third one is made by exporting the matrix. I have no complaints about it. It seems it works just fine, although I was just curious why the scientific format changed while importing and exporting. Actually, I think this is not a big issue.
Regards,
Radovan
Hi omorr,
I did not thought to format the cells for the exponentials... it not require a great effort, I could add this feature tonight

best regards,
w3b5urf3r
WroteHi omorr,
I did not thought to format the cells for the exponentials... it not require a great effort, I could add this feature tonight
best regards,
w3b5urf3r
As announced, feature added

Fixed: issues exporting data containing invisible brackets.
PLUGIN UPDATED
best regards,
w3b5urf3r
Wrote
..(or we can hope for a future evolution of the xls plugin...)
Thanks for the plugin update.
Just to clarify your comment, I don't get to understand it.
The new format of MS-Excel is xlsx (not xls) and they call it openxml, actually there is a free download for developers called "openxml sdk".
I assume that openoffice and alike may open simple .xlsx (like files with csv) even if only a limited support of excel features are supported.
Edit:
ok I got what you meant, no problem at least for me with Excel2007-SP1 (can't read ods) since I have installed LibreOffice, in general most people working professionally with Excel may have updated to a recent version with ods support, besides that Excel version has nearly 5 years.
Maybe I was thinking of the recent comment by Ioan about the plugin parsing a csv import by means of openxml.
http://exceldatareader.codeplex.com/
WroteThanks for the plugin update.
Just to clarify your comment, I don't get to understand it.
The new format of MS-Excel is xlsx (not xls) and they call it openxml, actually there is a free download for developers called "openxml sdk".
I assume that openoffice and alike may open simple .xlsx (like files with csv) even if only a limited support of excel features are supported.
Edit:
ok I got what you meant, no problem at least for me with Excel2007-SP1 (can't read ods) since I have installed LibreOffice, in general most people working professionally with Excel may have updated to a recent version with ods support, besides that Excel version has nearly 5 years.
Maybe I was thinking of the recent comment by Ioan about the plugin parsing a csv import by means of openxml.
Hi kilele,

For 'xls plugin' I meant the 'excelcollab plugin' made by Andrey or the second one on the Russian side of the forum (?).

Because the "openxml sdk" it's based on .NET 3.5 framework, I think that a homemade good plugin it's not easy to make because should be able to read all 4 xls* standards (xls, xlsx ECMA-376, xlsx ISO/IEC 29500 Transitional and the 'new' xlsx ISO/IEC 29500 Strict); so probably (but I'm not sure, because I don't know the differences between the 4 standards) the use of an external plugin as the one you proposed, might be a solution

Excel Data Reader seems very good, work under Windows with .Net Framework 2, Windows Mobile with Compact Framework, Linux, OS X, BSD with Mono 2+; unfortunately the plugin can only read files... I think this can be better http://closedxml.codeplex.com/ but works with .NET framework 4.0...
-
New Posts
-
No New Posts