473,394 Members | 2,063 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Search colon

Hi: How to i search ":" in a sentence. For eg:
abc efg hij : kkk ddd lll
fda fdasf jfdas fdas fsad

When i read a line i want to skip those lines where ":" is present

data = ts.ReadLine

Aug 10 '06 #1
4 1218
"Eric" <eh******@gmail.comwrote in message
news:11**********************@i42g2000cwa.googlegr oups.com...
Hi: How to i search ":" in a sentence. For eg:
abc efg hij : kkk ddd lll
fda fdasf jfdas fdas fsad

When i read a line i want to skip those lines where ":" is present

data = ts.ReadLine
If InStr(data,":") = 0 Then
' do your thing
End If
Aug 10 '06 #2

Eric wrote:
Hi: How to i search ":" in a sentence. For eg:
abc efg hij : kkk ddd lll
fda fdasf jfdas fdas fsad

When i read a line i want to skip those lines where ":" is present

data = ts.ReadLine
Consider using Regular Expressions - in my experience they're much
faster and easier than loops which perform string comparisons --
because you can return an entire matching file in one line of code --
but are tricky to get the hang of.

This site is a good place to start:
http://www.regular-expressions.info/index.html
http://www.regular-expressions.info/completelines.html

This site describes how to use them in ASP:
http://www.4guysfromrolla.com/webtech/090199-1.shtml

And finally this actual expression should match your original problem,
assuming you're using a text file:
^.*:.*$

This looks I just fell on the keyboard, but what it means is:
^.* = a series of 0 or more characters starting at the begining of
the line
: = your search condition, the colon in this case
..*$ = another series of 0 or more characters until the end of the line

Aug 10 '06 #3
Eric wrote:
Hi: How to i search ":" in a sentence. For eg:
abc efg hij : kkk ddd lll
fda fdasf jfdas fdas fsad

When i read a line i want to skip those lines where ":" is present

data = ts.ReadLine
You need the vbscript documentation. You can download it from here:
http://tinyurl.com/7rk6

--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Aug 10 '06 #4
Bobbo wrote:
>When i read a line i want to skip those lines where ":" is present

data = ts.ReadLine
...
And finally this actual expression should match your original
problem, assuming you're using a text file:
^.*:.*$
To take Bobbo's suggestion a bit further, you already know you have a single
line, so you can simply use : as your expression:

In JScript,
if (!/:/.test(data)) { do something }

In VBScript,
Set re = New RegExp
re.pattern = ":"
...
data = ts.ReadLine
If Not re.Test(data) Then
{ do something }
End If

--
Dave Anderson

Unsolicited commercial email will be read at a cost of $500 per message. Use
of this email address implies consent to these terms.
Aug 10 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Cindy Mueller | last post by:
--F0.5BD08B6_ABBB95C Content-Type: text/html; Content-Transfer-Encoding: quoted-printable <html> <body> <div align=3D"center"> <center> <table border=3D"0" cellspacing=3D"1" width=3D"100%">...
0
by: Maurice Mclain | last post by:
--7FC.__338__A.F0643A1 Content-Type: text/html; Content-Transfer-Encoding: quoted-printable <html> <body> <div align=3D"center"> <center> <table border=3D"0" cellspacing=3D"1"...
0
by: Lola Ervin | last post by:
--7F90A0.__A71 Content-Type: text/html; Content-Transfer-Encoding: quoted-printable <html> <body> <div align=3D"center"> <center> <table border=3D"0" cellspacing=3D"1" width=3D"100%"> <tr>
0
by: Carl Frey | last post by:
--E.3EC5.46C.DE_FF_ Content-Type: text/html; Content-Transfer-Encoding: quoted-printable <html> <body> <div align=3D"center"> <center> <table border=3D"0" cellspacing=3D"1" width=3D"100%">...
4
by: Henry Jordon | last post by:
I have everything pretty much done but I need to fix something in my coding. I want to be able to enter strings such as "love", "hate", "the", etc. but am unable to figure how to do this. I have...
2
by: Eric | last post by:
How to i search the colon in the data and then pick characters after colon. for eg: ACTUAL DATA Date: Fri Aug 04 15:14:38 EDT 2006 REQURED DATA Fri Aug 04 15:14:38 EDT 2006 Thanks,
2
by: Eric | last post by:
How to i search the colon in the data and then pick characters after colon. for eg: ACTUAL DATA Date: Fri Aug 04 15:14:38 EDT 2006 REQURED DATA Fri Aug 04 15:14:38 EDT 2006 Thanks,
10
by: B. Williams | last post by:
I have an assignment that requires me to write a program that uses a class, a constructor, a switch, and store the records in a text file. The second requirement is to create a function called...
161
by: Dan Lenski | last post by:
Hi all, I'm a recent, belated convert from Perl. I work in a physics lab and have been using Python to automate a lot of measurement equipment lately. It works fabulously for this purpose. ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.