473,507 Members | 8,335 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

opening .txt files and using them in the program

42 New Member
i would like to open a .txt file in my program and store it to a string.

i made a similar code in c++. and would like to know if i could also do it in VB

in c++ i used the .get() function is there a similar function in vb? and if there is i nid help in using it...

i nid to check each character of that text file and compare it if it is a period or not

if ( current character of file.txt == ' . ' ) then

output .txt = output.txt & next line
Jan 14 '07 #1
2 1200
akoymakoy
42 New Member
nevermind about the previous post i found a way how....


my question is how to search a string per character?

mystring = " John/noun is/verb tall/adjective"
i would like to search for "/" per string and get the word after it and store it to a new string
mystring2 = noun verb adjective
Jan 14 '07 #2
Killer42
8,435 Recognized Expert Expert
nevermind about the previous post i found a way how....
Glad to see you resolved that one.

my question is how to search a string per character?
mystring = " John/noun is/verb tall/adjective"
i would like to search for "/" per string and get the word after it and store it to a new string
mystring2 = noun verb adjective
Two methods come to mind. Both will involve loops. The first would be to run through and examine a character at a time, using the Mid( ) function. The second would be to use the Instr( ) function to find the position of each "/" in turn.

The Split( ) function may also be quite useful in this case - try looking it up. In fact, now that I think about it, use of Split may save you a lot of work compared to the aforementioned methods.
Jan 15 '07 #3

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

Similar topics

17
3815
by: SK | last post by:
I am calling an exe thru' href, but when it executes, I get the message if I want to open the file(exe file). Is there any way I can suppress this from appearing and open the program? Thank...
1
2747
by: DeeVee | last post by:
I am very new to the language. I am trying to open up to ten files from a list of many data files and writing them all to one big file. To do this I am getting them individually from the console...
1
4381
by: Alfons | last post by:
Hello, I have build a program that can do file transferring between a Windows XP computer and a DOS computer via a serial port. The Windows program I have build in C++ with Visual Studio 6.0....
0
1897
by: vinX | last post by:
Ok, i am making a file renaming utility, you can add filesize (in MB o KB), filepath, creation date and/or time, a counter, parent folder, th original name etc... I put the program in the...
1
1984
by: Anindya C via DotNetMonster.com | last post by:
When i want to open vs.net 2002 professional edition, a window installer message box appears saying: "Please wait while windows configures Microsoft Visual Studio .NET professional _english". After...
11
3570
by: aldrin | last post by:
I'm trying to run this code under windows xp sp2 using codeblocks v1.0 compiler with great difficulty.There is no problem with running this under KDevelop in linux. Any help would be greatly...
2
5003
by: Craig | last post by:
Hi there, I'm trying to open colour BMPs using PIL and I'm getting the following errors. Opening a 16 colour BMP I get: Traceback (most recent call last): File "<pyshell#3>", line 1, in...
12
1414
by: mohdalibaig | last post by:
Is it possible to open other files in C during main() execution. Example, i want to open a wave file that generates a sound when ever main() function is called.
0
5766
by: Jeremy Noring | last post by:
Hi, I have an application that loads various settings from the app.exe.config file. This has worked very well on w2k, XP, and Vista. However, recently I've been troubleshooting an issue on...
34
5297
by: Alexnb | last post by:
Gerhard Häring wrote: No, it didn't work, but it gave me some interesting feedback when I ran it in the shell. Heres what it told me: Traceback (most recent call last): File...
0
7221
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
7109
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
7313
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
7372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
5619
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3190
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1537
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.