473,382 Members | 1,692 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,382 software developers and data experts.

how to check a particular word in a text file is available using vb.net

i have stored all the elements in a xml file in a text file.i dont want to store all the elements but the distinct values,hence kindly reply
Mar 1 '12 #1
1 1426
!NoItAll
297 100+
Expand|Select|Wrap|Line Numbers
  1. Dim sText as String = my.computer.filesystem.readalltext(myfilename)
  2. 'case sensitive search
  3. If sText.contains(myString) then
  4.    'it is in there
  5. Else
  6.    'it is not in there
  7. End if
  8. 'case insensitive search
  9. If sText.ToLower.Contains(myString.tolower) then
  10.    'it is in there
  11. Else
  12.    'it is not in there
  13. End if
  14.  
Mar 29 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: panic attack | last post by:
Hello everbody, Our system is using Sql Server 2000 on Windows XP / Windows 2000 We have a text file needs to be imported into Sql Server 2000 as a table. But we are facing a problem which is,...
11
by: vivekgrs | last post by:
hi my requirement is read the data from the text file through vb. then calculate the data and write the result on the same text file where the data has retrived thru vb 6.0. how 2 implement...
1
by: sachin10 | last post by:
hi i m sachin, i m new to VB programming.i face some problem regarding the sorting of text file contents using arrays.text file have data in the format as below seq...
3
by: superc0red | last post by:
Hey, How i can open a text file using shellscripting, and new lines? for example i have the following text file: -------------------- Five Moroccans and a Syrian are charged with 191...
22
by: JJ | last post by:
Whats the best way for me to pull out records from a tab delimited text file? Or rather HOW do I parse the text, knowing that the tabs are field delimiters and a return (I image) signifies a new...
1
by: Paul Lemelle | last post by:
I am trying to read in a text file then use the data in the file. I know how to read a file wiht the System.IO namespace: FileRead fr = new StreamReader("data.txt");...
5
by: Myxamatosis | last post by:
Currently I need to read data from a file, such like this Measurements for Lansing, Michigan during April, 2000 63 32 0.00 54 43 0.10 59 39 0.00 46 24 0.00 52 20 0.00 54 30 0.00
7
by: elnoire | last post by:
Greetings! I've just started learning python, so this is probably one of those obvious questions newbies ask. Is there any way in python to check if a text file is blank? What I've tried to...
2
by: badwl24 | last post by:
Sir have saved some data in notepad like.... File = F:\Files\SWwork\My Assembly.SLDASM" " Mates" " Coincident1" "" " Coincident1" " Type = 0" " AlignFlag = 1" " ...
10
by: klharding | last post by:
I am reading the contents of a text file into variables. All works well if the text file does not exist, or it does exist and contains 4 rows of data. But I need to account for rows being empty or...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.