1 страниц (11 вхождений)
Excel - SMath conversion - Ioan - Сообщения
#1 Опубликовано: 11.12.2012 15:20:23
Hi everybody,
I need your help in order to transfer the table contented in the appended file (arcelor.csv) into a SMath matrix (186 lines; 27 columns).
I tried to follow the Dr Urroz’s tutor without success. It is not possible include all in a unique line.
Thanks a lot for any solution or suggestion
Ioan
arcelor.zip (9 КиБ) скачан 97 раз(а).
I need your help in order to transfer the table contented in the appended file (arcelor.csv) into a SMath matrix (186 lines; 27 columns).
I tried to follow the Dr Urroz’s tutor without success. It is not possible include all in a unique line.
Thanks a lot for any solution or suggestion
Ioan
arcelor.zip (9 КиБ) скачан 97 раз(а).
#2 Опубликовано: 11.12.2012 17:23:33
Hi Ioan,
seem there are issues with the first column (the beam type and size); I can not load the column even by enclosing the values in double quotes... except for that other data can be loaded without issues
regards,
w3b5urf3r
P.S. does anyone know the difference between the 3rd and the 4th arguments of importData(9)?
![SMath Studio - [arcelor.sm].png](/ru-RU/file/bQQHeG/SMath-Studio---_arcelor_sm__png)
seem there are issues with the first column (the beam type and size); I can not load the column even by enclosing the values in double quotes... except for that other data can be loaded without issues

regards,
w3b5urf3r
P.S. does anyone know the difference between the 3rd and the 4th arguments of importData(9)?
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#3 Опубликовано: 11.12.2012 18:06:11
Hi w3b5urf3r,
You have all my gratitude.
As usual, you have done a wonderful job.
As all good jobs, after it is done it seems so simple.
I will try to recover the fist column - text - in some other way.
Best regards,
Ioan
You have all my gratitude.
As usual, you have done a wonderful job.
As all good jobs, after it is done it seems so simple.
I will try to recover the fist column - text - in some other way.
Best regards,
Ioan
#4 Опубликовано: 12.12.2012 04:52:47
Hi,
the first column can be read using ExcelRead, this works as long as the cell content is a string or an integer.
Just save the csv as xls. Turn out that ImportData and ExcelRead have complementary features/bugs.
arg3 is arg delimiter for symbolic expressions (in case arg9=1), arg4 is column delimiter in the data file.
Best regards, Martin
Exceltest.sm (13 КиБ) скачан 67 раз(а).
the first column can be read using ExcelRead, this works as long as the cell content is a string or an integer.
Just save the csv as xls. Turn out that ImportData and ExcelRead have complementary features/bugs.
arg3 is arg delimiter for symbolic expressions (in case arg9=1), arg4 is column delimiter in the data file.
Best regards, Martin
Exceltest.sm (13 КиБ) скачан 67 раз(а).
Martin Kraska
Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 пользователям понравился этот пост
Davide Carpi 12.12.2012 06:52:00
#5 Опубликовано: 12.12.2012 07:05:50
Hi Martin,
Thank you very much.
Best regards,
Ioan
Thank you very much.
Best regards,
Ioan
#6 Опубликовано: 17.12.2012 13:50:45
#7 Опубликовано: 18.12.2012 07:52:59
Hello w3b5urf3r,
Hmm...To be honest, I am not quite sure about it. I just used importData(9) and not importData(1). The letter one, importData(1), sometimes reported errors like "The input string was not in a correct format" (not sure why) and I just stick with importData(9). I understood that the 3rd argument is the decimal separator in the text file (txt,csv). I put for the 4th argumnet zero (0) without paying to much attention on it meaning that the default value of function argument separator was used. Not quite sure when the function argument separator ( either "," or ";" ) should be changed and not using the default value.
Regards,
Radovan
EDIT: Sorry, I just saw the explanation by Martin
WroteP.S. does anyone know the difference between the 3rd and the 4th arguments of importData(9)?
Hmm...To be honest, I am not quite sure about it. I just used importData(9) and not importData(1). The letter one, importData(1), sometimes reported errors like "The input string was not in a correct format" (not sure why) and I just stick with importData(9). I understood that the 3rd argument is the decimal separator in the text file (txt,csv). I put for the 4th argumnet zero (0) without paying to much attention on it meaning that the default value of function argument separator was used. Not quite sure when the function argument separator ( either "," or ";" ) should be changed and not using the default value.
Regards,
Radovan
EDIT: Sorry, I just saw the explanation by Martin
Wrotearg3 is arg delimiter for symbolic expressions (in case arg9=1), arg4 is column delimiter in the data file.
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!"
1 пользователям понравился этот пост
Davide Carpi 18.12.2012 18:22:00
#8 Опубликовано: 18.12.2012 16:17:55
WroteCSV converted with LibreOffice and imported with DataExchange plugin
![]()
Best regards,
w3b5urf3r
Hi w3b5urf3r,
Of course it would be preferable if SMath could handle itself a clean Excel import/export operation.
Seeing that it is not yet the case, I appreciate much your practical solution; I hope it is welcome also for others.
BTW:
I've seen that once the "arcelor" table inputed in SMath, it can be read/write, as it is (with text columns included) or modified, with SMath rfile/wfile.
Once again - Thanks

Best Regards,
Ioan
1 пользователям понравился этот пост
Davide Carpi 18.12.2012 18:22:00
#9 Опубликовано: 21.12.2012 18:59:13
Ioan,
The attached sm file will import the 26 columns (2 through 27) of numeric data.
I don't have a means of importing text data.
Brett
arcelor_import.zip (1 КиБ) скачан 63 раз(а).
The attached sm file will import the 26 columns (2 through 27) of numeric data.
I don't have a means of importing text data.
Brett
arcelor_import.zip (1 КиБ) скачан 63 раз(а).
#10 Опубликовано: 25.12.2012 12:04:26
Ioan,
I probably wasn't clear enough. Sorry for the confusion. The smath file I uploaded on the 22nd (above) should provide you with the solution you're looking for... except that it doesn't handle text imports.
Good luck!
Brett
I probably wasn't clear enough. Sorry for the confusion. The smath file I uploaded on the 22nd (above) should provide you with the solution you're looking for... except that it doesn't handle text imports.
Good luck!
Brett
#11 Опубликовано: 23.07.2013 06:21:48
Hello All,
I've assembled (it's mostly copied and pasted from the internet) a quick and nasty way of copying a table from Excel so that it can be pasted as a matrix in SMath. Basically it converts the table in a csv string, adds the "mat(" function identifier at the beginning, the ",rows,cols)"at the end and puts it in the clipboard. Not rocket science and mostly not my work (the clipboard operations come from Microsoft itself!). You can paste the code in a macro module in Excel and use your own shortcut for "copying" your matrix. The code is attached as a Word document.
(I've removed the comments on the code as they are not mine...)
For the original code, look here: http://support.microsoft.com/kb/210216
NOTE: I'm aware that there are now built-in functions in SMath for importing data from Excel, but those who are less inclined to coding and only need a quick way of getting data out of a spreadsheet can, hopefully do a quick copy/paste and get on with their work...
XL2SMath.doc (25 КиБ) скачан 150 раз(а).
I've assembled (it's mostly copied and pasted from the internet) a quick and nasty way of copying a table from Excel so that it can be pasted as a matrix in SMath. Basically it converts the table in a csv string, adds the "mat(" function identifier at the beginning, the ",rows,cols)"at the end and puts it in the clipboard. Not rocket science and mostly not my work (the clipboard operations come from Microsoft itself!). You can paste the code in a macro module in Excel and use your own shortcut for "copying" your matrix. The code is attached as a Word document.
(I've removed the comments on the code as they are not mine...)
For the original code, look here: http://support.microsoft.com/kb/210216
NOTE: I'm aware that there are now built-in functions in SMath for importing data from Excel, but those who are less inclined to coding and only need a quick way of getting data out of a spreadsheet can, hopefully do a quick copy/paste and get on with their work...
XL2SMath.doc (25 КиБ) скачан 150 раз(а).
3 пользователям понравился этот пост
1 страниц (11 вхождений)
-
Новые сообщения
-
Нет новых сообщений