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
 Exporting all data worksheet in project

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
neutrondude Posted - 04/19/2010 : 10:49:10 AM
XP Prof/Origin 7.5

Dear all,
I would like to know how I can export all my data worksheet in my project to ASCII files. I have only three out of three columns I would like to export: lets call them A, B, C, D.
How can I export A C D??

I have an old export script- but I only succeed to export the "active window" (using the script window). How can I run the script over all datasets and only export the three columns I need ?

/ Setup the WKS.EXPORT object
wks.export.c1 = 1;
wks.export.c2 = 0; // All columns
wks.export.r1 = 1;
wks.export.r2 = 0; // All rows
wks.export.separator$ = "\t"; // Use TAB separator
wks.export.cntrl = 7; // Export Column Names + Data + Column Labels
// Loop over al worksheets in the project
doc -e W {
save -wh %H D:\TEMP\%H.DAT; // -wh uses WKS.EXPORT object
}


Thanks a lot in advance!!
3   L A T E S T    R E P L I E S    (Newest First)
greg Posted - 04/22/2010 : 2:26:39 PM
Your original script included header and ignored selection (cntrl=7).
To export selected data you must both select that data and use cntrl=8 (plus any other bits, but you now seem to want none).
Penn's wks.selcol(ColumnNum, mode) controls the selecting process for you. In case you have some columns selected in the sheet already, I would only add a 'de-selector' first. Also, to save the tedium of responding to that dialog constantly, this script gets a path then uses that path for all files and use the worksheet name for the file:

// Use this to get a default save path for all files
getsave dummy.dat;
%A=%[%A,1:%[%A]-9];
// Now loop over all the sheets
doc -e W {
wo -s; // Remove any existing selection
wks.colsel(1,1); // Select column 1
wks.colsel(3,1); // Select column 3
wks.colsel(4,1); // Select column 4
wks.export.cntrl = 8; // Just export selected data - no headers
wks.export.separator$ = "\t";
save -wh %H %A%H.DAT;
wo -s; // Remove our selections
}

Make sure you have the latest 7.5 to avoid issues with certain HP printer drivers.
http://www.originlab.com/www/support/resultstech.aspx?language=english&ID=1080
neutrondude Posted - 04/21/2010 : 04:40:07 AM
Dear Penn,
thanks a lot but I still cant make it work. I can only get an output if I have a marked worksheet and only this then get exported.
Also, it also selects all coloumns then..

How do I run the script and make it understand that certain coloumns of ALL worksheets needs to be exported without marking one by one?
Also I would like to avoid to include the coloumn names - i.e. to get pure data files.



quote:
Originally posted by Penn

Hi,

You can loop all worksheets to export the data. For each worksheet, the first thing is to set column A, C and D to be selected, then export the selected data. Please refer to the following script.

wks.export.separator$ = "\t"; // use Tab separator
wks.export.cntrl = 15; // export selected data, Column Names + Data + Column Labels
// loop all worksheets in the project
doc -e W {
wks.colSel(1, 1); // select column A
wks.colSel(3, 1);
wks.colSel(4, 1);
save -wh %H D:\TEMP\%H.DAT;
};

Penn
OriginLab Technical Services

Penn Posted - 04/20/2010 : 03:21:18 AM
Hi,

You can loop all worksheets to export the data. For each worksheet, the first thing is to set column A, C and D to be selected, then export the selected data. Please refer to the following script.

wks.export.separator$ = "\t"; // use Tab separator
wks.export.cntrl = 15; // export selected data, Column Names + Data + Column Labels
// loop all worksheets in the project
doc -e W {
wks.colSel(1, 1); // select column A
wks.colSel(3, 1);
wks.colSel(4, 1);
save -wh %H D:\TEMP\%H.DAT;
};

Penn
OriginLab Technical Services

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