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
 Reduction of text string for nameing column

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
yt47106 Posted - 12/01/2010 : 10:58:13 AM
Origin Ver. and Service Release (Select Help-->About Origin): 8.5 SR1
Operating System: XP sp3

Hi,

I´m importing data in CSV format and I would like to reduce the text string that is used for naming my columns, if possible already when importing the data file.
In the data file all parameters are named according to their full search path:
""aaaa""/""bbbb""/""ccccc""/""ParameterName""

I would like to keep only the last part of this string; ParameterName.
Can this perhaps be done by setting up some import filter or is there a better way?

Best regards, Bjorn
1   L A T E S T    R E P L I E S    (Newest First)
greg Posted - 12/01/2010 : 2:24:37 PM
The Import Wizard can create a filter with the option to run script to post-process, so you could write script that 'fixes' the names after importing or you could mark this row as Header, parse out the pieces and write script to name the columns. Either way, you need script and the first case seems to be the easier of the two.

// BEGIN SCRIPT
string str;
loop(ii,1,wks.ncols)
{
str$ = wcol(ii)[L]$;
num = str.GetNumTokens('/');
if(num > 0)
{
str$ = str.GetToken(num,'/')$;
str$ = %[%(str$),2:%[%(str$)]]; // strip extraneous "
wcol(ii)[L]$ = str$;
}
}
// END SCRIPT

Step through the Import Wizard and check the Save Filter option (and fill in details) then check the "Specify advanced filter options" and click Next. Paste the script into the large text box and click Finish.

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