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
 Extract/split data from long file
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

surjpanj

Canada
18 Posts

Posted - 06/18/2012 :  6:13:59 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,

I have measurements of around hundred pulses from oscilloscope (tdms files from NI) where data is contained in a single file; that is, values of all pulses are written in one column (e.g. first pulse is from 1 to 7000 rows, second pulse from 7001 to 14000, third from 14001 to 21000, etc.)

How can I extract individual pulses into separate columns (in one worksheet) without doing it manually? Can I use a script or any other function, which would do that automatically?

Thanks,

Matt

Kathy_Wang

China
159 Posts

Posted - 06/18/2012 :  9:52:14 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

For your case, I think you could define ranges for individual pulses and then put the values of each range to other columns,and you may use a loop to make it simpler, for example, if your original data is stored in column 1, and you are going to use column 2, 3, and 4 to store extracted data, you may do it as following(Minimum version:8.1):

  int i;
for(i=2;i<5;i++)
{
        //define the starting row of range
	int x=7000*(i-2)+1;
	//define the ending row of range
	int y=x+6999;
        //ra is the range to be extracted, rb is the new range to put extracted data
	range ra = col(1)[$(x):$(y)];
	range rb = col($(i));
	rb=ra;
}  


And actually, you may use the ImpNITDM x-function to import your .tdms file, this command will help to arrange the data from different channels to be in different columns/worksheets. For more info of this x-function, please refer to:
http://www.originlab.com/www/helponline/Origin/en/programming/mergedProjects/X-Function/X-Function/ImpNITDM.html

Also, there is another x-function "wxt" available for extracting data with testing conditions, you may refer to:
http://www.originlab.com/www/helponline/Origin/en/Programming/mergedProjects/X-Function/X-Function/Wxt.html

Hope this information helps!

Kathy
Originlab

Edited by - Kathy_Wang on 06/18/2012 10:14:17 PM
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