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
 How to delete data when use "win -c" command?
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

tantiger

Singapore
41 Posts

Posted - 10/04/2002 :  06:02:32 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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;

Mike Buess

USA
3037 Posts

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