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 columns in separate files .txt
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Afrancisco

Spain
4 Posts

Posted - 06/06/2018 :  04:33: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): OriginPro2018 SR1
Operating System: Windows 10

Hi!
I have some workbooks, with sheets full of columns, like 100 column in each sheet. The X is shared among all of them so I have that as the first column, and then all the other columns are data from spectrometry measurements.

I had it in separate .txt files when I imported them, then I modified them to match my needs, and now I need to export all of them into separate .txt again

The txt should be the first column the X, and then another of the Y columns, so if I have 100 Y columns, I should produce 100 .txt, one for each column. I do it manually, one by one, but this takes ages, do you know how could I make this automatic?

Thank you,

Adrian

JacquelineHe

287 Posts

Posted - 06/06/2018 :  05:50:37 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

In dialog, Origin does not support to export these texts automatically in the dialog.
I suggest you can use loop Labtalk script to export them.

1. Active the worksheet.

2.Copy the following script into Script Window (menu: Windows:Script Window)

for (ii=1; ii<=100; ii++)
{
wselcol mode:=skip sel:=1 skip:=ii-1 end:=ii+1;
expASC type:=text path:="D:\$(ii)" select:=1;
}

3. Highlight the script, press "Enter" key.
Then 100 text files will be exported to D disk, and auto name from 1 to 100.
And you update the path of the export script to change the folder.


To know more detail about the Labtalk script, plesae refer to these help pages:
Loop: https://www.originlab.com/doc/LabTalk/ref/For-cmd
Select Columns: https://www.originlab.com/doc/X-Function/ref/wselcol
Export Worksheet to ASCII: https://www.originlab.com/doc/X-Function/ref/expASC

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