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
 Batch Scripting Export
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

BryanK

Canada
26 Posts

Posted - 11/28/2014 :  08:32:33 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
V.9.0 windows 7

Hello,
I have written the following simple script for batch import.
%A = wks.name$;
%B = _treated;

wo -s;
wks.colsel(13,1);
wks.colsel(14,1);
wks.export.cntrl = 8;       // Just export selected data - no headers
wks.export.separator$ = "\t";
save -wh %H %A%B.dat;
wo -s; //Remove selections

It works fine in the script window and it works as expected for the final file if placed in the "Script at the end" box of Batch Processing.

Unfortunately, in the intended "Script after each process" box, files are exported empty (1 kb). Is it something that I have missed or is this a bug?

The idea is to export, en-mass, the final two columns of each -new- workbook with the name wks.name$_treated. Thus, ignoring empty books and books that were batch processed earlier.

Does anybody have any ideas?
Thanks,
Bryan

lkb0221

China
497 Posts

Posted - 12/03/2014 :  5:44:08 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

Please try using expASC X-Function to do the export:
http://www.originlab.com/doc/X-Function/ref/expASC

Zheng
OriginLab
Go to Top of Page

BryanK

Canada
26 Posts

Posted - 12/05/2014 :  06:10:11 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Wow. Thanks Zheng. That was incredibly easy! I made a quick change to my code which works perfectly in the batch window for each file:
fdlog.openpath(P); // choose directory;
%A = wks.name$;
%B = _treated;

wo -s;
wks.colsel(13,1);
wks.colsel(14,1);
expASC type:=1 path:=%P%A%B select:=1 separator:=1 longname:=0 units:=0 comment:=0;
wo -s;
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