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
 Forum for Origin C
 Simple Import/Data Manipulation/Export Macro

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
caaok Posted - 05/07/2009 : 2:34:15 PM
Origin Ver. 8.0724 and Service Release 0:
Operating System: Windows Vista

Basically I have a ton of worksheets in ASCII format, named "blah.0001", "blah.0002", etc. Here's what I currently have to do:

1. Import the file "blah.0001" as ASCII. Only columns 1,2,3,7 are relevant for my purposes.
2. Overwrite the data in column 2 with (column 7/column 3). Currently I use the "Set Column Values" feature to set column 2 this way.
3. Select column 1 and the newly overwritten column 2 and export these two columns as ASCII to the file "blah.001" (note the lack of third zero).

Basically I'm normalizing the data in column 7 with the values from column 3. This seems like the sort of thing that would be really easy to macro but I have no idea how. Ideally I'd be able to execute this on a massive scale, since I have hundreds of these files to go through, so perhaps import multiple ASCII and import all the files at once, then execute the macro?

Any tips for me? I have a BASIC knowledge of C from first year at university (I understand functions, if-else statements, loops, variables, etc), but I'm not sure how to get at the proprietary aspects of the origin data, or how to handle the file I/O.
2   L A T E S T    R E P L I E S    (Newest First)
Sophy Posted - 06/02/2009 : 05:25:37 AM
Hi caaok,

I guess in step2, you want to divide the data in column7 with that in column3, and assign the result to column2? If this is the case, you can simply type "col(2)=col(7)/col(3)", or use LT_execute("col(2)=col(7)/col(3)") in Origin C.

Notes:In LabTalk, column index is 1-offset.
Iris_Bai Posted - 05/26/2009 : 11:51:29 PM
Hi caaok,

After step 1 above I know you want to use Origin C to import ASCII data with partial columns and step 3 is want to export data from two columns to ASCII data file, right? Please refer to the example in this wiki linking for ASCII import
http://ocwiki.originlab.com/index.php?title=OriginC:ASCII_Import#To_show_how_to_do_partial_import

About export ASCII, we did not support simple Origin C function for customer. Would you mind to use X-Funciton? Hight the columns that want export and run the following in Command Window like running LabTalk.
expASC path:=c:\test\abc.txt select:=1
or in Origin C
LT_execute("expASC path:=c:\\test\\abc.txt select:=1");


But for step 2, could you give more details?

Iris

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