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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum
 Origin Forum
 ASCII import of row-based data
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

schneide

Germany
45 Posts

Posted - 11/23/2011 :  02:50:19 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

Hideo Fujii

USA
1582 Posts

Posted - 11/23/2011 :  10:27:13 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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

Edited by - Hideo Fujii on 11/23/2011 10:29:14 AM
Go to Top of Page

schneide

Germany
45 Posts

Posted - 11/30/2011 :  07:14:09 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

Hideo Fujii

USA
1582 Posts

Posted - 11/30/2011 :  12:16:27 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000