473,569 Members | 2,880 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 1202
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
3824
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 you, SK
1
2754
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 each time i run the program. For example each time I run the program I have to type: c:/dev-cpp/file1/vnov94_b.txt c:/dev-cpp/file1/faug74_a.txt...
1
4388
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. The DOS program I made in Turbo C++ 3.0. At this moment I am in a test phase of sending files and directories. The code I am using in DOS to open a...
0
1914
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 (registry: *.*\shell\myprogram\command(valu of the comand key is "...\myprogram.exe" "%1") context menu, so tha when you select multiple files, the paths...
1
1990
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 about 2 minutes of delay when the ide starts and when i try to open new project for vb.net an error message appears saying "VC package not avilable...
11
3577
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 appreciated. Enter an interesting string. Too many cooks spoil the broth Error opening C:\myfile.txt for writing. Program termnated. This...
2
5008
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 <module>
12
1421
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
5775
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 Windows Home Server (which is based on some variation of Windows Server 2003) and I've found that...
34
5319
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 "<pyshell#10>", line 1, in <module> os.startfile("C:\Documents and Settings\Alex\My Documents\My
0
7703
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7619
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7930
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8138
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7983
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6290
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3662
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2118
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 we have to send another system

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.