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
 Forum for Origin C
 CSV import and post processing
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

skramini

USA
2 Posts

Posted - 05/17/2016 :  7:53:23 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 9.0.0 and Service Release SR2 (Select Help-->About Origin):
Operating System: win 7

Hello, I would like to use Origin C or Labtalk to do the following.

1.Partial import (1201:1315) rows from say 1000 data sets as columns in a single worksheet. Each data set is a .txt file with timestamp in seconds as its label (eg: 0925628.txt)
2.Subtract first data set from each column to get differential spectrum

I never wrote code in Origin. Can someone help in this regard or at least show the direction I can go to.

Thank you,
Shiva.

jasonzhao

China
262 Posts

Posted - 05/17/2016 :  10:40:37 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

Please refer to the examples below for Partial Import by using LabTalk:
http://www.originlab.com/doc/LabTalk/examples/Data-Import#Partial_Import
and importing Multiple Files
http://www.originlab.com/doc/LabTalk/examples/Data-Import#Importing_Multiple_Files

Best regards!
Jason
OriginLab Technical Service
Go to Top of Page

harleybike01

USA
1 Posts

Posted - 05/19/2016 :  2:48:44 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Travels with Harley – Journeys in Search of Personal and National Identity, retired U.S. Army Colonel Christopher Holshek is organizing a National Service Ride from late August to late October to promote better citizenship, service, and social responsibility in and beyond America: “When we become better citizens, we become a better country – because, when you serve your community, you serve your country.”

http://www.nationalserviceride.net/

[url=http://www.nationalserviceride.net/]Travels with Harley[/url]
Go to Top of Page

skramini

USA
2 Posts

Posted - 05/19/2016 :  6:29:27 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello jason,
Thanks for the reply.
I was able to import the data into columns of my worksheet.
I need to subtract all these columns with a reference column.
Is it possible to write a small code that can do it for all the columns at a time.
I have about 200 columns and each has to be subtracted with a single reference column.
Thank you.
Shiva

quote:
Originally posted by jasonzhao

Hello,

Please refer to the examples below for Partial Import by using LabTalk:
http://www.originlab.com/doc/LabTalk/examples/Data-Import#Partial_Import
and importing Multiple Files
http://www.originlab.com/doc/LabTalk/examples/Data-Import#Importing_Multiple_Files

Best regards!
Jason
OriginLab Technical Service



Shiva K Ramini
Go to Top of Page

jasonzhao

China
262 Posts

Posted - 05/20/2016 :  03:31:56 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello,

You can try to loop through the columns in this way:

for(i=1;i<200;i++){ //loop through each column

col($(i))=col($(i))-col(201); // substrate by reference
}


Best regards!
Jason
OriginLab Technical Service
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