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 for Programming
 LabTalk Forum
 code help

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
codehelp Posted - 08/07/2019 : 08:56:55 AM
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 9.1.0
Operating System: Windows 7 Enterprise

Hi,

The following question is about writing a code for exporting specific columns as a dat file. My origin worksheet looks like this:

The data needs to be exported in several dat files,

First data file should contain: Col(A) Col(C) Col(H)
Second data file should contain: Col(A) Col(D) Col(H)
Third data file should contain: Col(A) Col(E) Col(H)
Fourth data file should contain: Col(A) Col(F) Col(H)
Fifth data file should contain: Col(A) Col(G) Col(H)

and the respective filenames would be 0.000_-29.9090mT, 0.000_-29.7990mT, 0.000_-29.0730mT and 0.000_-28.3700mT.

Each file contains the first and last column. The second column is the one which is changing in an incremental fashion. This is just an example with 5 files. In reality, I have datasets containing many more columns and it is time consuming to manually export each file by selecting the respective columns. Can someone help me with a code to automatically do this? Any help is appreciated.

Thanks in advance.

Best,
1   L A T E S T    R E P L I E S    (Newest First)
yuki_wu Posted - 08/08/2019 : 10:06:04 PM
Hi,

I think you could copy every combination (3 columns) to a new worksheet and then export these worksheets.

For copy columns, colcopy X-Funtion could help:
https://www.originlab.com/doc/X-Function/ref/colcopy

To export all worksheets as data file, this example is useful:
https://www.originlab.com/doc/LabTalk/examples/general-export#Export_all_worksheets_in_all_workbooks_in_all_folders_as_text_files

Regards,
Yuki

OriginLab

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