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
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Extract/split data from long file

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
surjpanj Posted - 06/18/2012 : 6:13:59 PM
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
1   L A T E S T    R E P L I E S    (Newest First)
Kathy_Wang Posted - 06/18/2012 : 9:52:14 PM
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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000