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
|
|
|