Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
detection chaine in other chaine
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  10 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
karamel  
View profile  
 More options Nov 3 2009, 6:36 pm
Newsgroups: microsoft.public.scripting.wsh
From: "karamel" <kara...@yahoo.fr>
Date: Tue, 3 Nov 2009 19:36:41 +0100
Local: Tues, Nov 3 2009 6:36 pm
Subject: detection chaine in other chaine
Hello

why i do for detect one string in a other string

example
j want find "toto" in an other string
if is good i do then
if is not good else

instr ? but i have bad response and it's no good

help please
thank


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pegasus [MVP]  
View profile  
 More options Nov 3 2009, 6:42 pm
Newsgroups: microsoft.public.scripting.wsh
From: "Pegasus [MVP]" <n...@microsoft.com>
Date: Tue, 3 Nov 2009 19:42:46 +0100
Local: Tues, Nov 3 2009 6:42 pm
Subject: Re: detection chaine in other chaine

"karamel" <kara...@yahoo.fr> wrote in message

news:4af0783c$0$907$ba4acef3@news.orange.fr...

> Hello

> why i do for detect one string in a other string

> example
> j want find "toto" in an other string
> if is good i do then
> if is not good else

> instr ? but i have bad response and it's no good

> help please
> thank

What you call a "chain" is called a "string" in English. I recommend that
you download the helpfile script56.chm from the Microsoft site. It gives you
a detailed explanation of the "instr" function, including a specific
example. If this does not suffice then you should post the code that does
not work for you.

    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Hz  
View profile  
 More options Nov 3 2009, 8:40 pm
Newsgroups: microsoft.public.scripting.wsh
From: Hz <h...@trashymail.com>
Date: Tue, 03 Nov 2009 21:40:37 +0100
Local: Tues, Nov 3 2009 8:40 pm
Subject: Re: detection chaine in other chaine

Here's a simple example I threw together, how to use regular expressions
to find all occurrences of a string inside another string:

'###########################################
Set find = CreateObject("VBScript.RegExp")
With find
        .Global = True
        .IgnoreCase = True
        .Pattern = "toto"
End With
testData = "-toto-Toto-tOto-toTo-totO-TOTO-"
Set finds = Find.Execute(testData)
For Each pos in finds
        WScript.Echo pos.Value & " " & pos.FirstIndex
Next
Set finds = Nothing
Set find = Nothing
'###########################################

Output:

toto 1
Toto 6
tOto 11
toTo 16
totO 21
TOTO 26

--
.::[ Hz ]::.


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Al Dunbar  
View profile  
 More options Nov 4 2009, 5:08 am
Newsgroups: microsoft.public.scripting.wsh
From: "Al Dunbar" <aland...@hotmail.com>
Date: Tue, 3 Nov 2009 22:08:15 -0700
Local: Wed, Nov 4 2009 5:08 am
Subject: Re: detection chaine in other chaine

"Pegasus [MVP]" <n...@microsoft.com> wrote in message

news:eI6HpVLXKHA.4588@TK2MSFTNGP04.phx.gbl...

Another useful bit of advise to the OP would be to suggest he include a copy
of the script that is giving a "bad response" so we would have a hope in
heck of being able to point out where he might have gone wrong.

/Al


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pegasus [MVP]  
View profile  
 More options Nov 4 2009, 7:11 am
Newsgroups: microsoft.public.scripting.wsh
From: "Pegasus [MVP]" <n...@microsoft.com>
Date: Wed, 4 Nov 2009 08:11:22 +0100
Local: Wed, Nov 4 2009 7:11 am
Subject: Re: detection chaine in other chaine

"Al Dunbar" <aland...@hotmail.com> wrote in message

news:OiA%23QzQXKHA.3696@TK2MSFTNGP02.phx.gbl...

Mmh. Isn't this what I suggested in my last sentence?

    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
karamel  
View profile  
 More options Nov 4 2009, 5:11 pm
Newsgroups: microsoft.public.scripting.wsh
From: "karamel" <kara...@yahoo.fr>
Date: Wed, 4 Nov 2009 18:11:19 +0100
Local: Wed, Nov 4 2009 5:11 pm
Subject: Re: detection chaine in other chaine
my script (bad, and j don't understand)
fullname is a fic name
______________________________________________________
   set fso_sansaccent_exeptions = fso.OpenTextFile(fichier_exeptions)
  while Not fso_sansaccent_exeptions.AtEndOfStream
   exeption = fso_sansaccent_exeptions.ReadLine

   if instr(fullname, exeption) <> 0 then
    wscript.echo fullname & " : EXEPTION, pas de traitement !!!!!!!!!"
else
        wscript.echo fullname & " : traitement !!!!!!!!!"

end if

  wend
________________________________________________________

thank you very much

"Hz" <h...@trashymail.com> a écrit dans le message de news:
%23BHOkXMXKHA.3...@TK2MSFTNGP04.phx.gbl...


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pegasus [MVP]  
View profile  
 More options Nov 4 2009, 6:02 pm
Newsgroups: microsoft.public.scripting.wsh
From: "Pegasus [MVP]" <n...@microsoft.com>
Date: Wed, 4 Nov 2009 19:02:50 +0100
Local: Wed, Nov 4 2009 6:02 pm
Subject: Re: detection chaine in other chaine

"karamel" <kara...@yahoo.fr> wrote in message

news:4af1b5b6$0$965$ba4acef3@news.orange.fr...

I can't entirely follow the logic in your script but I note two problems:
- You reversed the position of the two arguments in your "instr"-function.
- You performed a binary rather than an ASCII comparison.
Try this modified script:

fichier_exeptions = "d:\test.txt"
sFullName = "c:\boot.ini"
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set ofso_sansaccent_exeptions = oFSO.OpenTextFile(fichier_exeptions)
While Not ofso_sansaccent_exeptions.AtEndOfStream
   sLine = ofso_sansaccent_exeptions.ReadLine
   If InStr(1, sLine, sFullName, 1) > 0 Then
      WScript.echo sLine & " : EXEPTION, pas de traitement !!!!!!!!!"
   Else
      WScript.echo sLine & " : traitement !!!!!!!!!"
   End If
Wend


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Al Dunbar  
View profile  
 More options Nov 9 2009, 1:36 am
Newsgroups: microsoft.public.scripting.wsh
From: "Al Dunbar" <aland...@hotmail.com>
Date: Sun, 8 Nov 2009 18:36:18 -0700
Local: Mon, Nov 9 2009 1:36 am
Subject: Re: detection chaine in other chaine

"Pegasus [MVP]" <n...@microsoft.com> wrote in message

news:evjk83RXKHA.1232@TK2MSFTNGP05.phx.gbl...

Memo to self: try to remember to read more closely before responding. My
apologies.

/Al


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
karamel  
View profile  
 More options Nov 9 2009, 6:38 pm
Newsgroups: microsoft.public.scripting.wsh
From: "karamel" <kara...@yahoo.fr>
Date: Mon, 9 Nov 2009 19:38:37 +0100
Local: Mon, Nov 9 2009 6:38 pm
Subject: Re: detection chaine in other chaine
it's good thank you
bye

"Pegasus [MVP]" <n...@microsoft.com> a écrit dans le message de news:
uSNv%23jXXKHA.4...@TK2MSFTNGP06.phx.gbl...


    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pegasus [MVP]  
View profile  
 More options Nov 9 2009, 6:42 pm
Newsgroups: microsoft.public.scripting.wsh
From: "Pegasus [MVP]" <n...@microsoft.com>
Date: Mon, 9 Nov 2009 19:42:24 +0100
Local: Mon, Nov 9 2009 6:42 pm
Subject: Re: detection chaine in other chaine

"karamel" <kara...@yahoo.fr> wrote in message

news:4af861ad$0$968$ba4acef3@news.orange.fr...

> it's good thank you
> bye

Thanks for the feedback.

    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2010 Google