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 Filter for Text 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
AlexF Posted - 12/19/2017 : 06:56:30 AM
Hello everybody,

I am trying currently to import data with a filter function.
The problem is, I have one column with text, where I need to mask/mark some words and delete these.

Is there a function for such a simple task? My search was not successful.

Would be very thankful for any advice!
3   L A T E S T    R E P L I E S    (Newest First)
Hideo Fujii Posted - 12/21/2017 : 2:02:17 PM
Hi AlexF,

You can save the following script sample code in the "Script after Each File Imported" page in the
Import Wizard to save the filter (check Save Filter checkbox and Specify Advanced Filter Options"
checkbox in the last "Save Filter" page):
////////////////////////////
colnum=1;       //Column# to be searched
findStr$="AA";  //Search text
for(ii=1; ii<=wks.maxRows; ii++) //Loop over rows
  if(Find(wcol(colnum)[ii]$,findStr$,1)!=-1)  //If string is found
     for(jj=1; jj<=wks.nCols; jj++) wcol(jj)<ii>=1; //Mask the found row
////////////////////////////
You can customize the script for the column# to be searched, and the search string there.

Hope this helps.

--Hideo Fujii
OriginLab
AlexF Posted - 12/21/2017 : 06:35:06 AM
Dear Yuki,

thank you very much. Your solution works very good!


But in case I have a lot of files, is there a possibility to adapt it in an import filter?

Thank you!!

yuki_wu Posted - 12/20/2017 : 12:24:28 AM
Hi,

I think you could import your data into the worksheet, and then use Worksheet Query to mask some words:
1. Select Worksheet: Worksheet Query from menu
2. Select that column with text, for example, column C
3. Enter C == "AA" OR C=="BB" (AA and BB are that words you want to mask) in Condition box
4. Select Select option in Output item
5. Click Apply button


Then the rows will be selected, and you can delete them or mask them as you like.

Regards,
Yuki
OriginLab

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