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 for Programming
 LabTalk Forum
 code help
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

codehelp

Germany
1 Posts

Posted - 08/07/2019 :  08:56:55 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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,

yuki_wu

896 Posts

Posted - 08/08/2019 :  10:06:04 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
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