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
 How to delete data when use "win -c" command?

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
tantiger Posted - 10/04/2002 : 06:02:32 AM
I have a big problem here.
I used a script to import many ascii files at one time, it works fine.
However, when I check the OPJ file size, I reallized that all the
closed windows are still saved as the file is quite large.
I can use "list s" to see all of them and after I delete them, the OPJ file size decreased dramatically.

Is there any way of delete those temporary worksheets during importing?

the scripts as follows:
%L="F:\Data\DSC";
win -t wks Origin;
%W=%H;
%W!wks.joinmode=0; // Set %W worksheet to append mode
delete %(%W,2); delete %(%W,1);

FDLOG.DlgName$="Import DSC/DTA Files (TA Format)"; // Title Bar text
FDLog.CheckName$="DTA Files (Please Uncheck for DSC files!)";
//FDLog.Message$="DTA"; // Comment text
FDLog.CheckStatus=0;
FDLog.ShowComment=0;
FDLog.path$= %L;
FDLog.numtypes=3;
FDLog.type1$=[TXT files]*.TXT;
FDLog.type2$=[DAT files]*.DAT;
FDLog.type3$=[All files]*.*;
FDLog.defType=1;
FDLog.multiOpen.sort=1; // Sort only Groups selected!

If(FDLog.MultiOpen()!=0/0)
{
Loop(mmm,1,FDLog.MultiOpen.Count)
{ newcol=%W!wks.ncols;
FDLog.Get(A, mmm);
win -t wks origin wks$(mmm);
open -w %A;
%T=%H;
#!type "File #$(mmm) - %A";
%W!wks.join(%T);
delete %(%W,$(newcol+1));
win -c %T;
fnpos=0;
pathlength=%[%A];
For(ijk=pathlength; ijk>0; ijk--)
{
If ("%[%A,ijk:ijk]"=="\")
{
fnpos=ijk; //position of "\"
ijk=-10; //end condition
};
};
%B=%[%A,fnpos+1:pathlength-4];
%A=%[%Z,@7];%A=%[%A,"m"];%A=%[%A,>"e"];
#!Type "Name = %B Size = %A";
//win -a %W;
%W!wks.col$(newcol+1).type=4;
%W!wks.col$(newcol+1).label$="Temp,K";
%(%W,newcol+1)+=273.15;
//col($(newcol+1))+=273.15;
%W!wks.col$(newcol+2).label$="%B";
//col($(newcol+2))/=%A;
%(%W,newcol+2)/=%A;
}
}
%W!wks.labels();
#!type "All file imported sucessfully.";
del -v mmm;
work -s 0 0 0 0;
if(!FDLog.checkstatus)
{
work -p 200 DSC;
return;
}
else
work -p 200 DTA;
Return;
1   L A T E S T    R E P L I E S    (Newest First)
Mike Buess Posted - 10/04/2002 : 11:13:25 AM
In Origin 6.1 and 7.0 use 'win -cd %T' in place of 'win -c %T'. That will delete the datasets (columns) along with the worksheet window.

In Origin 5.0 and 6.0 you need this...

win -o %T {repeat wks.ncols {del col(1)}}; // delete all columns (win -o makes %T temporarily active)
win -c %T; // delete wks window

Hope that helps.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 10/04/2002 11:14:33 AM

Edited by - Mike Buess on 10/04/2002 11:17:07 AM

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