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
 Export multiple txt files from a single worksheet
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Ortiiiiiz

Mexico
2 Posts

Posted - 09/24/2013 :  4:01:07 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 8 SR 0
Operating System: Windows 7

Hi,

I am trying to export multiple .txt files from a single worksheet. This worksheet contains 130 columns, and I would like to have 65 files containing 2 columns each. Could you help me?

Thank you!

Eduardo O.

Eduardo O.

Hideo Fujii

USA
1582 Posts

Posted - 09/25/2013 :  10:41:29 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Eduardo,

You can try the following script:
/////////////////////////////////
src$=%H;
nc=wks.nCols;
win -t WKS;
dest$=%H;
dest$!wks.export.CNTRL=7;
for(ii=1; ii<=nc; ii=ii+2) {
  colcopy irng:=[src$]1!wcol(ii)   orng:=[dest$]1!col(1) lname:=1 units:=1 comments:=1;
  colcopy irng:=[src$]1!wcol(ii+1) orng:=[dest$]1!col(2) lname:=1 units:=1 comments:=1;
  save -wh %(dest$) %y%(src$)_$(ii).txt;
  type -a %y%(src$)_$(ii).txt saved;
}
win -cd %(dest$);
/////////////////////////////////
Hope this works as you wanted.

--Hideo Fujii
OriginLab

Edited by - Hideo Fujii on 09/25/2013 12:05:56 PM
Go to Top of Page

rainbowkoala

29 Posts

Posted - 09/26/2013 :  01:32:11 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
This is cool. I just thought there was not a simple solution.
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