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
 Origin Forum
 ASCII import of row-based data

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

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

* HTML is OFF
* Forum Code is ON
Smilies
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
schneide Posted - 11/23/2011 : 02:50:19 AM
Origin Ver. and Service Release (Select Help-->About Origin): Pro 8.5 SR1
Operating System: Win XP / Win7

Origin Ver. and Service Release (Select Help-->About Origin):
Operating System:

Is there an easy way to import ascii files which are structured in rows, not columns, e.g.

[x-values]
x-value1, x-value2, x-value3...
[y1-values]
y1-value1, y1-value2, y1-value3...
[y2-values]
y2-value2, y2-value2, y3-value3...


so that the worksheet looks like:

[x-values] [y1-values] [y2-values]...
x-value1 y1-value1 y2-value1
x-value2 y1-value2 y2-value2
x-value3 y1-value3 y2-value3
. . .
. . .
. . .

I can't find a way to configure the import wizzard accordingly. It seems like an obvious enough task so that a pre-installed method should exist?



Giselher
3   L A T E S T    R E P L I E S    (Newest First)
Hideo Fujii Posted - 11/30/2011 : 12:16:27 PM
Hi Giselher, 

Instead of the above one-line script, you can try the following script 
which adds the variable names to the column long names: 

//////////////////////////////////////////
worksheet -i 0 var; //insert at 1st column
nr=wks.maxRows;
nr2=nr/2;
for(ii=1; ii<nr; ii=ii+2) { //move var to 1st col
  col(1)[ii+1]$=col(2)[ii]$;
}
for(ii=1; ii<=nr2; ii++) {  //remove original var rows
  range bb = col(1)[ii:ii];
  mark -d bb;
}
wtranspose type:=long col:=first ow:=<new>; //transpose
delete col(1); //delete 1st column
//////////////////////////////////////////

Hope this works.

--Hideo Fujii
Originlab
schneide Posted - 11/30/2011 : 07:14:09 AM
Thanks,

this helps, but it is not perfect. For example there is no way to specify column name or comment with the information which is located in between the row-based values (in my example [x-values],[y-values1] etc.).



Giselher
Hideo Fujii Posted - 11/23/2011 : 10:27:13 AM
Hi Giselher,

In the last "Save Filters" page of the Import Wizard, you can turn ON the 
"Save Filter" check box, and enter the name of the filter; and turn ON the check 
box of "Specify Advanced Filter Options", and press "Next" button. 
Now you get the extra page, "Advanced Options". Enter the following x-function 
command in the box to transpose the impoort result:
   wtranspose;
Click Finish button to finish the process. 

Of course, you can also manually transpose the imported data after importing by choosing 
"Worksheet: Transpose" menu. 

Hope this helps. 

--Hideo Fujii
  OriginLab

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