Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Login


Options
Go to last post Go to first unread
Offline Ioan  
#1 Posted : 11 December 2012 22:20:23(UTC)
Ioan


Rank: Member

Groups: Registered
Joined: 17/06/2012(UTC)
Posts: 26
France, Metropolitan

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

File Attachment(s):
arcelor.zip (10kb) downloaded 67 time(s).

Wanna join the discussion?! Login to your SMath Studio Forum forum account. New Registrations are disabled.

Offline Davide Carpi  
#2 Posted : 12 December 2012 00:23:33(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,648
Man
Italy
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 Good


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):
arcelor.sm (178kb) downloaded 47 time(s).
Davide Carpi attached the following image(s):
SMath Studio - [arcelor.sm].png
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline Ioan  
#3 Posted : 12 December 2012 01:06:11(UTC)
Ioan


Rank: Member

Groups: Registered
Joined: 17/06/2012(UTC)
Posts: 26
France, Metropolitan

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
Offline mkraska  
#4 Posted : 12 December 2012 11:52:47(UTC)
mkraska


Rank: Advanced Member

Groups: Registered
Joined: 15/04/2012(UTC)
Posts: 1,988
Germany

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):
Exceltest.sm (14kb) downloaded 45 time(s).
mkraska attached the following image(s):
Excel1.PNG
Martin Kraska

Pre-configured portable distribution of SMath Studio: https://smath.com/wiki/SMath_with_Plugins.ashx
thanks 1 user thanked mkraska for this useful post.
on 12/12/2012(UTC)
Offline Ioan  
#5 Posted : 12 December 2012 14:05:50(UTC)
Ioan


Rank: Member

Groups: Registered
Joined: 17/06/2012(UTC)
Posts: 26
France, Metropolitan

Was thanked: 1 time(s) in 1 post(s)
Hi Martin,


Thank you very much.


Best regards,


Ioan
Offline Davide Carpi  
#6 Posted : 17 December 2012 20:50:45(UTC)
Davide Carpi


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 13/01/2012(UTC)
Posts: 2,648
Man
Italy
Location: Italy

Was thanked: 1332 time(s) in 876 post(s)
CSV converted with LibreOffice and imported with DataExchange plugin Biggrinirol:


Best regards,

w3b5urf3r


File Attachment(s):
Arcelor.zip (53kb) downloaded 42 time(s).
Davide Carpi attached the following image(s):
SMath Studio - [arcelor and DataExchange plugin.sm].png
If you like my plugins consider to support SMath Studio buying a plan; to offer me a coffee: paypal.me/dcprojects
Offline omorr  
#7 Posted : 18 December 2012 14:52:59(UTC)
omorr


Rank: Administration

Groups: Registered, Advanced Member
Joined: 23/06/2009(UTC)
Posts: 1,740
Man
Serbia

Was thanked: 318 time(s) in 268 post(s)
Hello w3b5urf3r,
Originally Posted by: w3b5urf3r_reloaded Go to Quoted Post
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 Go to Quoted Post
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!"
thanks 1 user thanked omorr for this useful post.
on 19/12/2012(UTC)
Offline Ioan  
#8 Posted : 18 December 2012 23:17:55(UTC)
Ioan


Rank: Member

Groups: Registered
Joined: 17/06/2012(UTC)
Posts: 26
France, Metropolitan

Was thanked: 1 time(s) in 1 post(s)
Originally Posted by: w3b5urf3r_reloaded Go to Quoted Post
CSV converted with LibreOffice and imported with DataExchange plugin Biggrinirol:


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 - ThanksClap


Best Regards,


Ioan
thanks 1 user thanked Ioan for this useful post.
on 19/12/2012(UTC)
Offline btowler  
#9 Posted : 22 December 2012 01:59:13(UTC)
btowler

Rank: Newbie

Groups: Registered
Joined: 26/06/2012(UTC)
Posts: 9
United States
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

File Attachment(s):
arcelor_import.zip (2kb) downloaded 41 time(s).
Offline btowler  
#10 Posted : 25 December 2012 19:04:26(UTC)
btowler

Rank: Newbie

Groups: Registered
Joined: 26/06/2012(UTC)
Posts: 9
United States
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
Offline marcofk  
#11 Posted : 23 July 2013 13:21:48(UTC)
marcofk


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/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...

Edited by user 23 July 2013 13:35:53(UTC)  | Reason: Not specified

File Attachment(s):
XL2SMath.doc (25kb) downloaded 121 time(s).
thanks 3 users thanked marcofk for this useful post.
on 23/07/2013(UTC),  on 23/07/2013(UTC),  on 23/07/2013(UTC)
Users browsing this topic
Guest
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.