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
 Origin Forum
 import data - delete fate file name

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
konstantinos_psiridis Posted - 02/24/2017 : 06:46:54 AM
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 :

2   L A T E S T    R E P L I E S    (Newest First)
konstantinos_psiridis Posted - 02/24/2017 : 1:36:15 PM
Hi Aviel Stern ,
thank you very much. you were very helpful.
arstern Posted - 02/24/2017 : 10:54:12 AM
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

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