Rank: Member Groups: Registered
Joined: 17/06/2012(UTC) Posts: 26 Was thanked: 1 time(s) in 1 post(s)
|
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
Edited by user 11 December 2012 23:01:02(UTC)
| Reason: Not specified
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,648 Location: Italy Was thanked: 1332 time(s) in 876 post(s)
|
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)? Edited by user 12 December 2012 00:29:23(UTC)
| Reason: Not specified File Attachment(s): Davide Carpi attached the following image(s): |
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
|
|
|
Rank: Member Groups: Registered
Joined: 17/06/2012(UTC) Posts: 26 Was thanked: 1 time(s) in 1 post(s)
|
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
|
|
|
|
Rank: Advanced Member Groups: Registered
Joined: 15/04/2012(UTC) Posts: 1,988 Was thanked: 1126 time(s) in 723 post(s)
|
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 File Attachment(s): mkraska attached the following image(s): |
|
1 user thanked mkraska for this useful post.
|
|
|
Rank: Member Groups: Registered
Joined: 17/06/2012(UTC) Posts: 26 Was thanked: 1 time(s) in 1 post(s)
|
Hi Martin,
Thank you very much.
Best regards,
Ioan
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 13/01/2012(UTC) Posts: 2,648 Location: Italy Was thanked: 1332 time(s) in 876 post(s)
|
CSV converted with LibreOffice and imported with DataExchange plugin irol: Best regards, w3b5urf3r File Attachment(s): Davide Carpi attached the following image(s): |
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects |
|
|
|
Rank: Administration Groups: Registered, Advanced Member Joined: 23/06/2009(UTC) Posts: 1,740 Was thanked: 318 time(s) in 268 post(s)
|
Hello w3b5urf3r, Originally Posted by: w3b5urf3r_reloaded 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 Originally Posted by: mkraska arg3 is arg delimiter for symbolic expressions (in case arg9=1), arg4 is column delimiter in the data file.
Edited by user 18 December 2012 14:56:47(UTC)
| Reason: Not specified |
When Sisyphus climbed to the top of a hill, they said: "Wrong boulder!" |
1 user thanked omorr for this useful post.
|
|
|
Rank: Member Groups: Registered
Joined: 17/06/2012(UTC) Posts: 26 Was thanked: 1 time(s) in 1 post(s)
|
Originally Posted by: w3b5urf3r_reloaded CSV converted with LibreOffice and imported with DataExchange plugin irol: 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 user thanked Ioan for this useful post.
|
|
|
Rank: Newbie
Groups: Registered
Joined: 26/06/2012(UTC) Posts: 9 Location: Massachusetts
|
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
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 26/06/2012(UTC) Posts: 9 Location: Massachusetts
|
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
|
|
|
|
Rank: Member Groups: Registered
Joined: 01/02/2012(UTC) Posts: 19 Location: UK
Was thanked: 8 time(s) in 4 post(s)
|
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/210216NOTE: 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... Edited by user 23 July 2013 13:35:53(UTC)
| Reason: Not specified
|
3 users thanked marcofk for this useful post.
|
on 23/07/2013(UTC), on 23/07/2013(UTC), on 23/07/2013(UTC)
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.