Excel - SMath conversion

Excel - SMath conversion - Ioan - Messages

#1 Posted: 12/11/2012 3:20:23 PM
Ioan

Ioan

1 likes in 26 posts.

Group: User

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 KiB) downloaded 94 time(s).
#2 Posted: 12/11/2012 5:23:33 PM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

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
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#3 Posted: 12/11/2012 6:06:11 PM
Ioan

Ioan

1 likes in 26 posts.

Group: User

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
#4 Posted: 12/12/2012 4:52:47 AM
Martin Kraska

Martin Kraska

1222 likes in 2150 posts.

Group: Moderator

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 KiB) downloaded 66 time(s).
Martin Kraska Pre-configured portable distribution of SMath Studio: https://en.smath.info/wiki/SMath%20with%20Plugins.ashx
1 users liked this post
Davide Carpi 12/12/2012 6:52:00 AM
#5 Posted: 12/12/2012 7:05:50 AM
Ioan

Ioan

1 likes in 26 posts.

Group: User

Hi Martin,


Thank you very much.


Best regards,


Ioan
#6 Posted: 12/17/2012 1:50:45 PM
Davide Carpi

Davide Carpi

1415 likes in 2872 posts.

Group: Moderator

CSV converted with LibreOffice and imported with DataExchange plugin


Best regards,

w3b5urf3r



SMath Studio - [arcelor and DataExchange plugin.sm].png
If you like my plugins please consider to support the program buying a license; for personal contributions to me: paypal.me/dcprojects
#7 Posted: 12/18/2012 7:52:59 AM
Radovan Omorjan

Radovan Omorjan

325 likes in 2052 posts.

Group: Moderator

Hello w3b5urf3r,
Wrote

P.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
Wrote

arg3 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 users liked this post
Davide Carpi 12/18/2012 6:22:00 PM
#8 Posted: 12/18/2012 4:17:55 PM
Ioan

Ioan

1 likes in 26 posts.

Group: User

Wrote

CSV 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 users liked this post
Davide Carpi 12/18/2012 6:22:00 PM
#9 Posted: 12/21/2012 6:59:13 PM
btowler

btowler

0 likes in 9 posts.

Group: User

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 KiB) downloaded 62 time(s).
#10 Posted: 12/25/2012 12:04:26 PM
btowler

btowler

0 likes in 9 posts.

Group: User

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
#11 Posted: 7/23/2013 6:21:48 AM
marcofk

marcofk

8 likes in 19 posts.

Group: User

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 KiB) downloaded 149 time(s).
3 users liked this post
ioan92 7/23/2013 9:08:00 AM, Davide Carpi 7/23/2013 9:35:00 AM, Вячеслав Мезенцев 7/23/2013 4:03:00 PM
  • New Posts New Posts
  • No New Posts No New Posts