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 data - delete fate file name
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

konstantinos_psiridis

Greece
2 Posts

Posted - 02/24/2017 :  06:46:54 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
OriginPro 2016 64-bit
I want to import datas that they are export from another program, so they are .EXP types. The file's name goes to the comment section and after that i am using it to plot datas. Is there any automatic method to hide that .EXP, from the legend's name ?

IMAGE :

arstern

USA
237 Posts

Posted - 02/24/2017 :  10:54:12 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Konstantinos,

Thank you for your post. Below are steps to help you with importing the files.

To solve your problem you must import your data through Import Wizard, within Import Wizard you can create a new parameter in the workbook that specifies the file name while excluding the .EXP

1) Select Import Wizard

2) Select your data under data source. Next Select Start New Columns within Import Mode.Select Next >>

3) From Extract variables from file names and file headers Select Specify location of variable names and values using delimiters and Select Create User Parameter rows for each variable, Select Next >>

4) In the following page, the top white box should list the file name with and without the extension. Under Variable, select the line you wish to add. Select Enter variable name and specify the name. Select Add. This will specify your new variable in the grey box. Select Next >>

5) Skip Data Columns and Data Selection and Select Next (twice) >>

6) Under Save filters, you can save this import wizard setting so that you do not have to repeat these steps every time you import a file. Select Save filter box and under Filter Description name your filter. If you wish, you can also specify the file type to apply this filter under Specify data file names to which this filter will be associated....Select Finish.

To use this filter setting again, when you select Import Wizard you must initially select List filters applicable to both Data Type and file name under Import filter and then Select the tab next to the Import Filters to the current Data Type to select the filter you want to use.

When you plot, the legend automatically lists the columns from Comments. Because you are creating a new parameter in the workbook rather the columns in Comments, when you plot you will need to either 1) redefine the legend as your new parameter or 2) you will need to copy and paste the new parameter row into Comments.

OR

In the Import Wizard settings you can create a script that takes the file names in each column within the new parameter that you created and input into the Comments row. To write a script: Under Save Filters Select Specify advanced filters options, Select Next >>

In the white box under Script after All Files Imported input a script. Below is an example that you can use, note fname is the defined variable we gave for the new parameter created:

The goal of this loop is to 1) place all the columns in row fname into the row comments and to 2) hide row fname

loop (j,1,wks.ncols)
{
wcol(j)[C]$ =wcol(j)[fname]$; //places fname into comments
}
wks.UserParam1=0; //hides fname row in the workbook

For more information on writing scripts with LabTalk
http://www.originlab.com/doc/LabTalk/ref/Wks-obj

Hope this helps!

--Aviel Stern
OriginLab

Edited by - arstern on 02/24/2017 12:19:49 PM
Go to Top of Page

konstantinos_psiridis

Greece
2 Posts

Posted - 02/24/2017 :  1:36:15 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Aviel Stern ,
thank you very much. you were very helpful.
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