The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Splitting vector rowwise

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List

* Forum Code is ON
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

Check here to subscribe to this topic.

T O P I C    R E V I E W
couturier Posted - 12/07/2021 : 11:04:42 AM
Origin Ver. and Service Release (Select Help-->About Origin): 2022
Operating System: win10

I have a xml file in which I read a string value that actually represents many vectors
string looks like this:
and so on"

I can put it into a vector<string> with GetTokens(), but then I need to further extract each element into separate vectors.
This is doable with a loop but this is way too slow (I have more than 20000 lines)

Is there any method that could speed things up ?
This string has the same structure than an ascii file, would it be possible to use ImportASCIIFile(), with a string instead of a file ?

3   L A T E S T    R E P L I E S    (Newest First)
minimax Posted - 01/19/2022 : 01:36:35 AM

In 2022b Beta version, we added a function SetByText() for matrixbase.

void st(string str="1,2,3\r\n2,3,4\r\n7,8,9\r\n")
		matrix<int> mm;
		Worksheet wks = Project.ActiveLayer();
		mm.CopyTo(wks);//default will transpose

People who is interested may try.
couturier Posted - 12/08/2021 : 02:38:57 AM
thanks a lot
cpyang Posted - 12/07/2021 : 2:14:20 PM
We can easily add this to matrixbase, I added


The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000