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 Filter for Text Column
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

AlexF

2 Posts

Posted - 12/19/2017 :  06:56:30 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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!

yuki_wu

896 Posts

Posted - 12/20/2017 :  12:24:28 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

AlexF

2 Posts

Posted - 12/21/2017 :  06:35:06 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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!!

Go to Top of Page

Hideo Fujii

USA
1582 Posts

Posted - 12/21/2017 :  2:02:17 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
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