searching for values not in this range.

I've this array of alaphets.

Eg {"a", "d", "k")

I want to search for values NOT in the above range, what is the syntax like 
?





0
IT
6/30/2010 4:24:44 AM
windows.powershell 690 articles. 0 followers. Follow

3 Replies
892 Views

Similar Articles

[PageSpeed] 52

On Jun 29, 9:24=A0pm, "IT STAFF" <jkk...@hotmail.com> wrote:
> I've this array of alaphets.
>
> Eg {"a", "d", "k")
>
> I want to search for values NOT in the above range, what is the syntax li=
ke
> ?

I'm assuming you're talking about single characters.  If the exclusion
range isn't overly large, then you can do this:

PS C:\Users\tojo> $exclusions =3D 'a', 'd', 'k'
PS C:\Users\tojo> $characters =3D 'a', 'b', 'c', 'd', 'e'
PS C:\Users\tojo> $characters | ?{$exclusions -notcontains $_}
b
c
e


That will output the characters that are not contained in the
exclusion list.
0
tojo2000
6/30/2010 4:42:16 AM
I cannot define $exclusions first, in another words, $exclusions can be 
"anything". User can key anything they want.

Is that a generic way to say "not within the range" defined by $characters.




"tojo2000" <tojo2000@gmail.com> wrote in message 
news:cd8b9f56-aa48-42cf-89ef-385ab1e8329c@w9g2000prn.googlegroups.com...
On Jun 29, 9:24 pm, "IT STAFF" <jkk...@hotmail.com> wrote:
> I've this array of alaphets.
>
> Eg {"a", "d", "k")
>
> I want to search for values NOT in the above range, what is the syntax 
> like
> ?

I'm assuming you're talking about single characters.  If the exclusion
range isn't overly large, then you can do this:

PS C:\Users\tojo> $exclusions = 'a', 'd', 'k'
PS C:\Users\tojo> $characters = 'a', 'b', 'c', 'd', 'e'
PS C:\Users\tojo> $characters | ?{$exclusions -notcontains $_}
b
c
e


That will output the characters that are not contained in the
exclusion list. 


0
IT
7/1/2010 2:18:56 AM
Something like this?

   $userinput = read-host -prompt "Exclusions?"
   $exclusions = $userinput -Split ''
   $exclusions = $exclusions[1..-1]
   $characters = 'a', 'b', 'c', 'd', 'e'
   $characters | ? {$exclusions -notcontains $_}

  - Larry

On 6/30/2010 9:18 PM, IT STAFF wrote:
> I cannot define $exclusions first, in another words,
 > $exclusions can be "anything". User can key anything they want.
> Is that a generic way to say "not within the range" defined by $characters.
>
>
> "tojo2000"<tojo2000@gmail.com>  wrote in message
> news:cd8b9f56-aa48-42cf-89ef-385ab1e8329c@w9g2000prn.googlegroups.com...
> On Jun 29, 9:24 pm, "IT STAFF"<jkk...@hotmail.com>  wrote:
>> I've this array of alaphets.
>>
>> Eg {"a", "d", "k")
>>
>> I want to search for values NOT in the above range, what is the syntax
>> like
>> ?
>
> I'm assuming you're talking about single characters.  If the exclusion
> range isn't overly large, then you can do this:
>
> PS C:\Users\tojo>  $exclusions = 'a', 'd', 'k'
> PS C:\Users\tojo>  $characters = 'a', 'b', 'c', 'd', 'e'
> PS C:\Users\tojo>  $characters | ?{$exclusions -notcontains $_}
> b
> c
> e
>
>
> That will output the characters that are not contained in the
> exclusion list.
>
>
0
Larry__Weiss
7/1/2010 2:59:57 AM
Reply:

Similar Artilces:

Calculating greatest number in a range
This is a little tricky to explain, but hopefully will make sense. A series of data is produced that monitors concurrent users on a system. This is returned every five minutes of every day. This is on a work book which has a month for each tab. Data typically comes in the following, simple form: Wed Nov 26 10:50:01 GMT 2008 0 Wed Nov 26 10:55:00 GMT 2008 0 Wed Nov 26 11:00:00 GMT 2008 1 Wed Nov 26 11:05:00 GMT 2008 1 Wed Nov 26 11:10:00 GMT 2008 1 Wed Nov 26 11:15:00 GMT 2008 1 Wed Nov 26 11:20:00 GMT 2008 1 Essentially, I need a way of differentiating between indivi...

Search last 4 digits in an (account number)
I store bank accunt and credit card numbers in various Contact Notes. For example, a credit card # as xxxxxxxxxxxx1234. Outlook contact search would not find this contact if I enter the search for "1234". Is there a way to do this in Outlook 2007? TIA PS - this search works fine in Outlook Mobile. outlook searches from the beginning - so it will only work if you use xxxxxxxxxxxx 1234. Other search tools (like google desktop) may find it. -- Diane Poremsky [MVP - Outlook] Outlook Tips: http://www.outlook-tips.net/ Outlook & Exchange Solutions Center: htt...

adjustable range radar chart
Hi, I have a radar chart which displays three series of data (and the data labels from a heading column). The problem I have is that the number of points in the series changes depending on the dataset which I import (from 8 to 14 points or anything in between). Each of the three series and the heading label data always have an equal number of data points to each other. How can I get the radar chart to configure itself to display the correct number of datapoints only (and not have spare plotting points or miss points in the case of a larger series)? Hope you can help, Matt ...

Look for: Search In => Choose folders=> Search subfolders not working
When I search for an old email using Outlook's Look for: box and specify which folders to search in via the "Choose folders=>Search subfolders" checking a folder does not actually cause any subfolders to be checked. Unless there is some other setting and/or option hidden away somewhere, the "Search subfolders" check box is not working. I must manually check all the desired subfolders. What am I doing wrong? -- Regards, Peter Sale Santa Monica, CA USA To email me, just pull 'my-leg.' ...

Searching for Newsgroups
I subscribe to a Usenet service for accessing various news groups. After I download all the newsgroups from that server I can not find a way to search for the newsgroups I have interest in. When I put something like "RV" in the search box on the top right corner, it searches all of my Emails rather than just the list of groups that had "RV" in the title. Help tells me that there is a " Display newsgroups containing" box but for the life of me I can't find it. Any thoughts out there? I am running Entourage 12.2.3 Dunc Click the bar in th...

Search & replace in formulae
Is it possible to do a search and replace which includes the cell formula contents ? I have a workbook that has cells which link to the contents of a cell in another workbook and I'd like to know if the naming has to remain constant or if I can replace a part of the name periodically. ie each year. thanks "Iain Rhodes" <iain@pricejam.com> wrote in message news:8ec201c49682$858c5d20$a501280a@phx.gbl... > Is it possible to do a search and replace which includes > the cell formula contents ? I have a workbook that has > cells which link to the contents of a cel...

Looking Up the First Nonzero Value in a Column
Hello everyone, I am looking for a function that can return the first nonzero value in a column. I have a table that has months across the top and down the leftmost column. The data in the table are balances as of each month, essentially. It looks like this: J F M A M J 1 F 2 1 M 3 2 1 A 4 3 2 1 M 5 4 3 2 1 Is there a way to say, "Look in the column labeled "F" and return the first nonzero number"? Then the cell below it will need to be the number directly below that first number, and so on. I'd appreciate any help. Thanks! Sincerely, T...

How to total cells in a range with data input
Greetings to all members I am running Excel 97. An office colleague presented me with an issue that might be of interest to any Excel whiz and seasoned programmers. I would certainly appreciate any pointers in solving it. So here goes. The set of values includes 33 cells ranging from B4:D14. The data type is numeric. Data is only input in a few cells. QUESTION What would be the function to enter in, say, cell A15 to indicate the total number of cells in range B4:D14 that have received data input? Or does it involve some behind the scene VBA programming? EXAMPLE B6 = 9 C9 = 4 D11 ...

cell value
How can i test if a cell is empty or if it is a value in it? THNX -- wasss ----------------------------------------------------------------------- wasssu's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=1605 View this thread: http://www.excelforum.com/showthread.php?threadid=27509 wasssu User Defined Function. Function IsEmpty(Searchrange As Range) As Boolean IsEmpty = (Application.CountA(Searchrange) = 0) End Function Returns TRUE or FALSE If not familiar with VBA and macros, see David McRitchie's site for more on "getting started". http...

Search engine optimization
Hello all! My question today regarding this issue is: I have noticed some sites have the following on their sites "Source". meta name= "robots" content="Index, follow" meta name= "revisit-after" content="15 days" or (30 days) What does this function accomplish as far as search engines go? and will it really imporve your results ( rankings) Like for instance "robots" "index, all" what is the difference between this and saying "robots" "index, follow" I'm a bit confused about this. Can someone ...

Copying only the numerical values
Is it possible to have a summary worksheet in an Excel spreadsheet and then copy this worksheet on its own to another document but with the numerical values only? I have a worksheet which is a summary of various other Excel documents linked together. I wish to email this summary page with the numerical values only. I don't particularly want the file paths showing in the document I email - I just wish the numerical values - not the formulas which produce these values. Is this possible? Without going through complicated procedures. "SM" <theesel1994REMOVE@googlemail...

Can I search identical fields from multiple tables?
I have a database to log details about staff in my school. I have a tables for staff details, courses, absence, educational visits etc. In each table I have a date field to show when the member of staff is not present. I want to produce a query to search all tables by entering a date - e.g. to bring back all results for staff who are not in school on a certiain day because they are either ill, on a course or on an educational visit. The query will work by entering a date once - it will then search all the other tables and bring back the results. Is this possible? Do I restructure? ...

different values count
Hi, guys!!! need some help... each day i record one or more record at the end of the month I must count the working day of the mount counting only dates that are different. that is: 20/09/2004 abcabcabc 20/09/2004 abcabcabc 20/09/2004 abcbabcab 21/09/2004 abcbabcba 22/09/2004 abcababcb 22/09/2004 abababcba 23/09/2004 acbcbabcb working days = 4 (the 20, 21, 22 and 23) is there any function that count different values i'm coming crazy to solve this problem... thanks to you al -- ramalin ----------------------------------------------------------------------- ramalina&#...

lookup over multiple ranges
I want something to the effect: =if(iserror(vlookup(a1,range1,2,false)),vlookup(a1,range2,2,false),vlookup(a1,range1,2,false)) but I want to do this without using an if iserror function. Is there a way to do this? An array formula perhaps? Thanks. it is possible, if both Range1 and Range2 contain same number of rows Step1 Define range name Range1 = $e$5:$f$10 Range2 = $k$5:$l$10 .. .. .. Lookup Value placed in H5 =vlookup(h5, indirect("Range"&sumproduct((e5:e10=h5)*1+(k5:k10=h5)*2)),2) <thedevilkaiser@gmail.com> ???????:1164072471.121573.61230@m73g2000cwd.googleg...

What does outlook search when you search Contacts ?
When you do a search in oulook for contacts, what is the criteria that outlook searches? Or I guess how does outlook search? Why is it not consistant? The reason I am asking is that we have our customers contacts in public folders. In our customers we have 6 contacts for XYZ Foods. If you search in outlook for just "XYZ" it only comes back with 4 of the six. If you do a search for "XYZ Foods" it returns with all 6. And if you just entered "Foods" no contacts were found. And we actually have a few companies in our contacts who's names are a two part name ending...

Historical Stock Close Value
I'm trying to get the Historical Closing Price of stocks. I recorded a macro that will download, and also found several scripts that will download historical info for stocks. However it downloads a table for the stock with "Open", "Hi", "Low", but I do not want the whole table, I only want the "Close" price. Is there a way to do this? I do this sort of thing often. If desired, send your file to my address below. I will only look if: 1. You send a copy of this message on an inserted sheet 2. You give me the newsgroup and the...

Vlookup data wrong if the small value found are same
Dear Friends, I need to find the smallest 8 amounts from hundreds of data and look up the data of the corresponding amount. So I used the small function with referrence to the Rank column and found two -100,000.00 and each of them related to Joey and Keith. However, the vlookup function retrieved both data as Joey and lost Keith's Number and Name. Same problem occurs if retrieving the top 10 amounts with large function. Thanks for your great help in advance. Fanny Rank Amount Number Name 1 -156,250.00 8 John 2 -120,547.00 13 Peter 3 -103,100.00 541 Mary 4 -1...

excel VBA
How would i search a range of a whole column instead of specific cells like .Range("a1:a300")? --- Message posted from http://www.ExcelForum.com/ ..range("a:a") ..columns(1) ..range("a1").entirecolumn are a few ways. "Zygoid <" wrote: > > How would i search a range of a whole column instead of specific cells > like .Range("a1:a300")? > > --- > Message posted from http://www.ExcelForum.com/ -- Dave Peterson ec35720@msn.com ahhh! Thanks!! I was trying .Column(1) i see i neede an "s" in there Thanks a...

retrieving maximum value from query
hi there, I have a table of the following schema build --------------------------- build_id AutoNumber build_date Date/Time label Text CL Number ---------------------------- for a simple query like SELECT build.CL FROM build; how can I apply a filter so that I only get the max CL value? thanks in advanced. SELECT Max(CL) FROM build If you want the details about the entry with the largest value, you could try: SELECT build_id, build_date, label, CL FROM build WHERE CL IN (Select Max(CL) FROM build) Recognize, of course, th...

Multiple fields using to search
Hi, Something i've been batteling for weeks with and theres probably such a simple answer to it and i just cant see it: Riiiight, i have this form (lets call it frmClientSearch) On this form i have a 2 list box thinghys; One called lstEmployee which is populated with Employee names and the other lstCity which is populated with City Names. Then i have a command button (cmdSearch) which, once click and values selected in both the lst boxes, should return only the values that are equal to both the lst boxes in a new form called frmSearchResult. (Hope i make sense) So... I know how ...

Filter out rows based on the value of a cell
Using Windows XP and Excel 2007 Would like to create a search box of sorts, where when I type a word into a specific cell, let's say B2, then the rows displayed filter out based on what I typed, so that only rows where column D equaled "Smith" for example, would show. It would also be helpful if I could select a value from a dropdown next to it determining which column would be checked for the filtering. For example, I type "Smith" in cell B2, and then select "Last Name" from the drop down so that the rows displayed are filtered by showing only rows where the...

Search, Search, Thanks
In the last couple of weeks I have been fighting with different ways o synching my laptop and my home pc. I have ended up with numerou duplicate entries, duplicate address books and duplicate contact lists ALL of my questions/problems I was able to resolve simply by searchin through the forums. Chances are if you have a problem you're not th first. There are some really good people on these forums that know alo more about Outlook than I do. Just my .02 Thank ----------------------------------------------- ~~ Message posted from http://www.ExcelTip.com ~~View and post usenet messages dir...

Range Question
I would like to be able to grab the row information from the first Do-While loop (column D) and use it to create a range for the ActiveCell.Copy and PasteSpecial (column J), instead of using a loop to find once again an empty value. This works, but I couldn't figure out the code for the range to make it run faster. Any help is greatly appreciated. Thanks, Mike Range("D2").Select Do While ActiveCell.Value <> Empty ActiveCell.Offset(1, 0).Select Loop For I = 1 To 15 ActiveCell.Offset(1, 0).EntireRow.Delete Next I Range("J2").Select...

Including imap folders in outlook 2003 search folders
Dear all, Is it possible to include imap accounts/folders as providers for "virtual" search folders in outlook 2003? At the moment, I only see the option to check folders in my personal folders but not to include imap folders. The reason that I ask is that I would like to be able to get a complete view of follow up tasks across all my accounts (1 pop3, 2 imap and 1 hotmail). Only the pop3 account gets delivered into the personal folders and is included in the follow up a nd unread search folders. Thanks for your help in advanced. Raj ...

Display search results
Using OneNote 2010 Beta: file tabs are on the left; how can I make search result tabs appear on the right? Now they don't appear at all: the first search result is displayed in the middle of the screen (that's fine) but no way to move to the next search result, nor any way to scrool them all the search results. I'd like to see all the search result tabs listed on the right so I can choose the one I want (as was the case with the version of OneNote that got replaced by 2010 beta). Many thanks for any help. -- CH I can't really visualize what you want, but h...