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
 Import file name as variables without extention
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

ivydong

USA
14 Posts

Posted - 02/25/2013 :  9:57:17 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): v8.1.34.90
Operating System: Win7

I'm using the batch processing and trying to use the file names without extension as column values in the result sheet. When I work on the template, I added variables and their values in the import wizard by specifying the delimiters. The extensions are gone when I try to insert variables in the template workbook(it was saved as a link). When it comes to batch processing, I was expecting to see only the variable part of the file name in the report result, so that I can use the number to do calculation(without the file extension). However, it always showed as the full file name (with the extension). Is there any way I can either do something with the template, or get rid of the extension in the report workbook? I mean all I need is changing column values from "20.txt" to "20" will be fine. Thank you for your help.

easwar

USA
1965 Posts

Posted - 02/27/2013 :  5:45:55 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi ivydong,

Perhaps you can send your analysis template to support and we can take a look? You can use the "Send File to Tech support" link on the top of this page, and then refer to this post in your message.

Another solution is the following:
1> Do not worry about extracting file name in your filter etc - just import the data and set up the analysis template for your operations

In the Batch Processing tools, after you pick all the files you want to process:
2> Set the Dataset Identifier drop-down to File Name, this will add a 1st column in the Output sheet which will have the file name with the extension.
3> In the same dialog, expand the Script branch, and in the "Script at the End" edit box, enter this script:

range r1=1;
for(int ir=1; ir<=r1.GetSize(); ir++)
{
   str$ = r1[ir]$;
   r1[ir]$ = str.GetFileName(1)$;
}
r1.format=1;


Then at the end of the batch processing task, the script will run automatically and convert the 1st column by stripping off the extension and also converting the column to type numeric.

Easwar
OriginLab
Go to Top of Page

ivydong

USA
14 Posts

Posted - 03/05/2013 :  01:03:46 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you so much, Easwar. It works like a charm!!!
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