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
 LabTalk Forum
 file import

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
OndrejMM Posted - 07/12/2009 : 9:12:25 PM
Hi Guys,
I do have simple problem,… I would need to import a two-column file which contains multiple data. I was using the Import wizard but I cannot make it work,… data have the following format:
// empty row
X AD-S11-data // column short names
// empty row
0 6.31982 //data
0.52 2.72977
1.03 54.2017
// empty row
// empty row
// empty row
X AD-S22-data //column short names (new worksheet)
// empty row
0 5.98143 // data
0.52 -3.74441
// empty row
// empty row
// empty row
X AD-S22-data //column short names (new worksheet)
// empty row
0 5.98143 // data
0.52 -3.74441
0.52 -5.26446
etc.

I would like to put a new set of data to a new worksheet that partially works within the “import wizard” using “non-numeric data in a numeric filed => start new worksheet” but since a number of empty rows is changing everything is shifted,…

do you have any idea how can I make this working? I was thinking that maybe I can first import all the data into a worksheet and then split them? because there is always X,…

cheers, Ondrej
2   L A T E S T    R E P L I E S    (Newest First)
OndrejMM Posted - 07/16/2009 : 10:09:01 PM
thank you Larry, sure it helps,...
cheers, ondrej
larry_lan Posted - 07/15/2009 : 04:23:58 AM
Hi Ondrej:

You have to import all your data into worksheet first and then split it. For example, run the following script after imported. (Or you can also put the script in the Advance tab of Import Wizard)

range s1 = %(wks.name$)!col(a); // Get source column
range s2 = %(wks.name$)!col(b);
jj=1;
for(ii=1; ii<=$(wks.maxrows); ii++)
{
	// If found "X", new a worksheet to store data
	if(s1[ii]$ == "X")
	{
		newsheet;
		col(a)[L]$ = s1[ii]$; // Set column labels
		col(b)[L]$ = s2[ii]$;
		jj=1;
		ii++;
	};
	range n1 = col(a);
	range n2 = col(b);
	if(s1[ii] != NULL )
	{
		n1[jj] = s1[ii];
		n2[jj] = s2[ii];
		jj++;
	}
}


Hope this helps.

Larry
OriginLab Technical Services

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